aboutsummaryrefslogtreecommitdiff
path: root/crypto
AgeCommit message (Collapse)AuthorFilesLines
2015-09-07Updates for NumericString supportMatt Caswell1-4/+14
Ensure that EBCDIC support works and update a comment. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-07Add NumericString supportDmitry Belyavsky2-2/+19
GOST requires improved NumericString support. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-09-06Remove warning about use of uninitialised variableRichard Levitte1-2/+1
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-06Avoid direct X509 structure accessDr. Stephen Henson6-21/+25
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-06Replace X509 macros with functionsDr. Stephen Henson1-0/+25
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-05Make TS structures opaque.Rich Salz11-86/+347
Most of the accessors existed and were already used so it was easy. TS_VERIFY_CTX didn't have accessors/settors so I added the simple and obvious ones, and changed the app to use them. Also, within crypto/ts, replaced the functions with direct access to the structure members since we generally aren't opaque within a directory. Also fix RT3901. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-05RT3955: Reduce some stack usageRich Salz2-25/+43
Use malloc/free instead of big onstack buffers. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-05In X509_STORE_CTX_init, cleanup on failuremrpre1-27/+33
Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-05RT3951: Add X509_V_FLAG_NO_CHECK_TIME to suppress time checkDavid Woodhouse1-0/+4
In some environments, such as firmware, the current system time is entirely meaningless. Provide a clean mechanism to suppress the checks against it. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-05make X509_REVOKED opaqueDr. Stephen Henson1-0/+11
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-04RT3998: Allow scrypt to be disabledRich Salz3-0/+7
This does 64-bit division and multiplication, and on 32-bit platforms pulls in libgcc symbols (and MSVC does similar) which may not be available. Mostly done by David Woodhouse. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-09-04More zalloc nitsRich Salz2-2/+1
Found on GitHub by dimman Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-03Revert "OPENSSL_NO_xxx cleanup: RFC3779"David Woodhouse6-0/+18
This reverts the non-cleanup parts of commit c73ad69017. We do actually have a reasonable use case for OPENSSL_NO_RFC3779 in the EDK2 UEFI build, since we don't have a strspn() function in our runtime environment and we don't want the RFC3779 functionality anyway. In addition, it changes the default behaviour of the Configure script so that RFC3779 support isn't disabled by default. It was always disabled from when it was first added in 2006, right up until the point where OPENSSL_NO_RFC3779 was turned into a no-op, and the code in the Configure script was left *trying* to disable it, but not actually working. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-03remove 0 assignments.Rich Salz42-378/+73
After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-03Add UEFI flag for rand buildLong, Qin1-2/+2
Add OPENSSL_SYS_UEFI flag for RAND handling; Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-03Win32 build fix: include internal/numbers.h to get UIN32_MAXRichard Levitte1-0/+1
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-03RT3674: Make no-cms build work.David Bar5-3/+27
Also has changes from from David Woodhouse <David.Woodhouse@intel.com> and some tweaks from me. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-03PBE lookup testDr. Stephen Henson1-25/+15
Add test to check PBE lookups: these can fail if the PBE table is not correctly orders. Add to "make test". Reviewed-by: Matt Caswell <matt@openssl.org>
2015-09-02Check OPENSSL_gmtime_diffRich Salz1-60/+0
It's test code that only runs on 64bit time_t machines. Move it to a standalone test/gmdifftest Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-02Add and use OPENSSL_zallocRich Salz32-131/+64
There are many places (nearly 50) where we malloc and then memset. Add an OPENSSL_zalloc routine to encapsulate that. (Missed one conversion; thanks Richard) Also fixes GH328 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-02make updateDr. Stephen Henson3-8/+12
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-02make X509_CRL opaqueDr. Stephen Henson9-0/+75
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-02Cleaner handling of "cnid" in do_x509_checkViktor Dukhovni1-3/+7
Avoid using cnid = 0, use NID_undef instead, and return early instead of trying to find an instance of that in the subject DN. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-02Better handling of verify param id peername fieldViktor Dukhovni2-1/+13
Initialize pointers in param id by the book (explicit NULL assignment, rather than just memset 0). In x509_verify_param_zero() set peername to NULL after freeing it. In x509_vfy.c's internal check_hosts(), avoid potential leak of possibly already non-NULL peername. This is only set when a check succeeds, so don't need to do this repeatedly in the loop. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-01functions to retrieve certificate flagsDr. Stephen Henson1-0/+22
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-01RT4002: check for NULL cipher in p12_crpt.cEmilia Kasper1-0/+3
The NULL cipher case can't actually happen because we have no EVP_PBE_CTL combinations where cipher_nid is -1 and keygen is PKCS12_PBE_keyivgen. But make the code more obviously correct. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-31make updateDr. Stephen Henson3-11/+15
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-31Add X509_up_ref function.Dr. Stephen Henson14-25/+28
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-31Add X509_CRL_up_ref functionDr. Stephen Henson6-11/+16
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-31check bn_new return valuemrpre1-2/+2
Slightly modified from the original PR. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-08-31make X509_REQ opaqueDr. Stephen Henson9-0/+37
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-31make X509_CERT_AUX opaqueDr. Stephen Henson4-0/+17
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-31GH367 follow-up, for more clarityBen Kaduk1-4/+4
Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-31BN_mod_exp_mont_consttime: check for zero modulus.Emilia Kasper1-3/+4
Don't dereference |d| when |top| is zero. Also test that various BIGNUM methods behave correctly on zero/even inputs. Follow-up to b11980d79a52ec08844f08bea0e66c04b691840b Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-28GH354: Memory leak fixesAlessandro Ghedini3-24/+13
Fix more potential leaks in X509_verify_cert() Fix memory leak in ClientHello test Fix memory leak in gost2814789 test Fix potential memory leak in PKCS7_verify() Fix potential memory leaks in X509_add1_reject_object() Refactor to use "goto err" in cleanup. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-27GH367: Fix dsa keygen for too-short seedIsmo Puustinen1-17/+12
If the seed value for dsa key generation is too short (< qsize), return an error. Also update the documentation. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-27Fix memory over-readRich Salz1-1/+1
Fix from David Baggett via tweet. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-08-26Fixed problem with multiple load-unload of comp zlibDavid Brodski1-1/+3
Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-26Remove _locked memory functions.Rich Salz2-121/+2
Undocumented, unused, unnecessary (replaced by secure arena). Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-08-26BN_bin2bn handle leading zero'sRich Salz1-1/+4
If a binary sequence is all zero's, call BN_zero. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-24Add DSA digest length checks.Dr. Stephen Henson1-4/+14
Reviewed-by: Ben Laurie <ben@openssl.org>
2015-08-17Add new GOST OIDsDmitry Belyavsky5-5/+305
Add new OIDs for latest GOST updates Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-14CCM support.Dr. Stephen Henson1-4/+88
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-13GH364: Free memory on an error pathIsmo Puustinen1-1/+2
Part of RT 3997 Per Ben, just jump to common exit code. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-08-12Return error for unsupported modes.Dr. Stephen Henson1-5/+30
PR#3974 PR#3975 Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-12Fix memory leak if setup fails.Dr. Stephen Henson1-1/+1
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-12Err isn't always malloc failure.Dr. Stephen Henson1-1/+1
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-11Remove Gost94 signature algorithm.Rich Salz1-1/+0
This was obsolete in 2001. This is not the same as Gost94 digest. Thanks to Dmitry Belyavsky <beldmit@gmail.com> for review and advice. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-11Check for 0 modulus in BN_MONT_CTX_setMatt Caswell1-0/+3
The function BN_MONT_CTX_set was assuming that the modulus was non-zero and therefore that |mod->top| > 0. In an error situation that may not be the case and could cause a seg fault. This is a follow on from CVE-2015-1794. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-08-10RT3999: Remove sub-component version stringsRich Salz33-64/+0
Especially since after the #ifdef cleanups this is not useful. Reviewed-by: Matt Caswell <matt@openssl.org>