Commit Graph

13 Commits

Author SHA1 Message Date
Gary Lin
9bc647e2b2 Cryptlib: implement strcmp() and strcasecmp()
strcmp() and strcasecmp() are widely used in openssl. Implement those
two functions to eliminate the gcc warnings and the potential crash.

Signed-off-by: Gary Lin <glin@suse.com>
2017-04-11 10:42:19 -04:00
Gary Lin
e883479f35 Cryptlib: amend the headers and fix signness
- Declare some functions in the proper headers
  + We missed them for a long time...

- Cast offsetof to UINTN
  + The original casting triggers the gcc warning since int can not
    present the offset for the 64bit machines.

- Cast the "char" array to "CHAR8 *" to avoid the gcc warnings

- Implement atoi correctly

Signed-off-by: Gary Lin <glin@suse.com>
2017-04-11 10:42:19 -04:00
Gary Lin
d064bd7eef Cryptlib: Update to the latest edk2 commit
- Update to edk2 commit 7c410b3d4180087020c7734bf67cdc4ad9fdb136
  CryptoPkg/BaseCryptLib: Adding NULL checking in time() wrapper.

- Update headers in Cryptlib/Include/openssl/ to 1.1.0e
  + Also copy the openssl internal headers

Signed-off-by: Gary Lin <glin@suse.com>
2017-04-11 10:42:18 -04:00
Gary Lin
ab9a05a10f Cryptlib: Rename OpenSslSupport.h as CrtLibSupport.h
Edk2 renamed OpenSslSupport.h, so we have to follow the change.
Also merge some changes from edk2 CrtLibSupport.h

Signed-off-by: Gary Lin <glin@suse.com>
2017-04-11 10:42:18 -04:00
Gary Lin
8321529865 Update Cryptlib
Update to edk2 commit 6e4489d8129d233ef0fe85eeb6eebfecafe9ea6e
(CryptoPkg: Refine type cast for pointer subtraction)

Also replaced CryptAes.c, CryptArc4.c, CryptTdes.c, CryptMd4.c,
CryptHmacMd5.c, and CryptHmacSha1.c with the Null version since
we don't really need those functions.

Signed-off-by: Gary Lin <glin@suse.com>
2017-03-24 18:28:30 -04:00
Gary Lin
7ab40ee92c Cryptlib: Implement memset() to avoid the potential crash
Although the prototype of memset() is already defined in OpenSslSupport.h,
the function was never implemented. It was fine since a macro was
designed to replace all memset() with SetMem() after including
OpenSslSupport.h. However, since openssl 1.0.2j, a new function pointer
in crypto/mem_clr.c requires the "real" memset() or the program would
crash due to the NULL function pointer access. This commit implements
memset() (just a wrapper of SetMem()) to avoid the potential crash.

Signed-off-by: Gary Lin <glin@suse.com>
2016-11-30 12:57:34 -05:00
Gary Lin
7b9281af14 Update the CryptLib
Update to the edk2 commit 5e2318dd37a51948aaf845c7d920b11f47cdcfe6

Signed-off-by: Gary Lin <glin@suse.com>
2016-09-06 15:05:36 -04:00
Matthew Garrett
aa8f89d08f Reapply patches lost in the update 2013-10-04 11:51:09 -04:00
Matthew Garrett
9107ff9046 Update to current Tiano Cryptlib 2013-10-04 11:51:09 -04:00
Gary Ching-Pang Lin
f6d1f6aa32 Adjust the result of gmtime() to fit the definition 2013-09-26 11:58:02 -04:00
Gary Ching-Pang Lin
ad23233e2d Enable openssl bio_printf()
bio_printf() was replaced with a dummy function and this made
several openssl functions useless. This commit adds the print
functions back, so that we don't have to implement our own
ASN1 time print function.
2013-09-26 11:58:02 -04:00
Matthew Garrett
f7d6ecac5f Cryptlib update 2012-07-09 10:17:13 -04:00
Matthew Garrett
9579a36336 Add crypto libraries 2012-06-18 17:49:57 -04:00