X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CryptoPkg%2FLibrary%2FBaseCryptLib%2FSysCall%2FCrtWrapper.c;h=fb446b677044c35764c9e86bf1c7e8782ced1901;hp=b9daaee0bc0d7aa685c95a14bc262d2a3392f5f5;hb=b7d320f8117ed2fffe001b1a0b7bfcd4f40fafc4;hpb=4a567c9690db97ecbf982e9428727f073bada504 diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c index b9daaee0bc..fb446b6770 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c @@ -2,7 +2,7 @@ C Run-Time Libraries (CRT) Wrapper Implementation for OpenSSL-based Cryptographic Library. -Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -15,6 +15,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include +int errno = 0; + +FILE *stderr = NULL; +FILE *stdin = NULL; +FILE *stdout = NULL; + typedef INTN (*SORT_COMPARE)( @@ -238,7 +244,10 @@ void qsort (void *base, size_t num, size_t width, int (*compare)(const void *, c ASSERT (base != NULL); ASSERT (compare != NULL); - Buffer = AllocatePool (width); + // + // Use CRT-style malloc to cover BS and RT memory allocation. + // + Buffer = malloc (width); ASSERT (Buffer != NULL); // @@ -246,7 +255,7 @@ void qsort (void *base, size_t num, size_t width, int (*compare)(const void *, c // QuickSortWorker (base, (UINTN)num, (UINTN)width, (SORT_COMPARE)compare, Buffer); - FreePool (Buffer); + free (Buffer); return; } @@ -298,3 +307,144 @@ void *UI_OpenSSL(void) { return NULL; } + +int X509_load_cert_file (VOID *ctx, const char *file, int type) +{ + return 0; +} + +int X509_load_crl_file (VOID *ctx, const char *file, int type) +{ + return 0; +} + +int chmod (const char *c, mode_t m) +{ + return -1; +} + +int close (int f) +{ + return -1; +} + +void closelog (void) +{ + +} + +#ifdef __GNUC__ + +typedef +VOID +(EFIAPI *NoReturnFuncPtr)( + VOID + ) __attribute__((__noreturn__)); + + +STATIC +VOID +EFIAPI +NopFunction ( + VOID + ) +{ +} + + +void exit (int e) +{ + NoReturnFuncPtr NoReturnFunc; + + NoReturnFunc = (NoReturnFuncPtr) NopFunction; + + NoReturnFunc (); +} + +#else + +void exit (int e) +{ +} + +#endif + +int fclose (FILE *f) +{ + return 0; +} + +FILE *fopen (const char *c, const char *m) +{ + return NULL; +} + +size_t fread (void *b, size_t c, size_t i, FILE *f) +{ + return 0; +} + +int fprintf (FILE *f, const char *s, ...) +{ + return 0; +} + +uid_t getuid (void) +{ + return 0; +} + +uid_t geteuid (void) +{ + return 0; +} + +gid_t getgid (void) +{ + return 0; +} + +gid_t getegid (void) +{ + return 0; +} + +off_t lseek (int a, off_t o, int d) +{ + return 0; +} + +void openlog (const char *c, int a, int b) +{ + +} + +ssize_t read (int f, void *b, size_t c) +{ + return 0; +} + +int stat (const char *c, struct stat *s) +{ + return -1; +} + +int strcasecmp (const char *c, const char *s) +{ + return 0; +} + +int strncasecmp (const char *c, const char *s, size_t l) +{ + return 0; +} + +void syslog (int a, const char *c, ...) +{ + +} + +ssize_t write (int f, const void *b, size_t l) +{ + return 0; +}