summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/x_name.c
AgeCommit message (Collapse)Author
2017-09-07Fix error handling/cleanupRich Salz
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4326) (cherry picked from commit 180794c54e98ae467c4ebced3737e1ede03e320a)
2017-02-06Combined patch for the more or less obvious issuesBernd Edlinger
Fixed a memory leak in ASN1_digest and ASN1_item_digest. asn1_template_noexp_d2i call ASN1_item_ex_free(&skfield,...) on error. Reworked error handling in asn1_item_ex_combine_new: - call ASN1_item_ex_free and return the correct error code if ASN1_template_new failed. - dont call ASN1_item_ex_free if ASN1_OP_NEW_PRE failed. Reworked error handing in x509_name_ex_d2i and x509_name_encode. Fixed error handling in int_ctx_new and EVP_PKEY_CTX_dup. Fixed a memory leak in def_get_class if lh_EX_CLASS_ITEM_insert fails due to OOM: - to figure out if the insertion succeeded, use lh_EX_CLASS_ITEM_retrieve again. - on error, p will be NULL, and gen needs to be cleaned up again. int_free_ex_data needs to have a fallback solution if unable to allocate "storage": - if free_func is non-zero this must be called to clean up all memory. Fixed error handling in pkey_hmac_copy. Fixed error handling in ssleay_rand_add and ssleay_rand_bytes. Fixed error handling in X509_STORE_new. Fixed a memory leak in ssl3_get_key_exchange. Check for null pointer in ssl3_write_bytes. Check for null pointer in ssl3_get_cert_verify. Fixed a memory leak in ssl_cert_dup. Fixes #2087 #2094 #2103 #2104 #2105 #2106 #2107 #2108 #2110 #2111 #2112 #2115 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2127)
2016-05-04Fix name length limit check.Dr. Stephen Henson
The name length limit check in x509_name_ex_d2i() includes the containing structure as well as the actual X509_NAME. This will cause large CRLs to be rejected. Fix by limiting the length passed to ASN1_item_ex_d2i() which will then return an error if the passed X509_NAME exceeds the length. RT#4531 Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 4e0d184ac1dde845ba9574872e2ae5c903c81dff)
2016-04-29Add size limit to X509_NAME structure.Dr. Stephen Henson
This adds an explicit limit to the size of an X509_NAME structure. Some part of OpenSSL (e.g. TLS) already effectively limit the size due to restrictions on certificate size. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 295f3a24919157e2f9021d0b1709353710ad63db)
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-04RT2914: NULL check missing in X509_name_canonRich Salz
Check for NULL return from X509_NAME_ENTRY_new() Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit 2c60925d1ccc0b96287bdc9acb90198e7180d642)
2012-02-27PR: 2736Dr. Stephen Henson
Reported by: Remi Gacogne <rgacogne-bugs@coredump.fr> Preserve unused bits value in non-canonicalised ASN1_STRING structures by using ASN1_STRING_copy which preseves flags.
2011-09-05Fix memory leak on bad inputs.Bodo Möller
2011-09-02Don't use *from++ in tolower as this is implemented as a macro on someDr. Stephen Henson
platforms. Thanks to Shayne Murray <Shayne.Murray@Polycom.com> for reporting this issue.
2009-01-28Typo: just copy across an unknown type.Dr. Stephen Henson
2008-07-04Avoid warnings with -pedantic, specifically:Dr. Stephen Henson
Conversion between void * and function pointer. Value computed not used. Signed/unsigned argument.
2008-06-06Fix memory leak. The canonical X509_NAME_ENTRY STACK is reallocated ratherDr. Stephen Henson
than referencing existing X509_NAME_ENTRY structures so needs to be completely freed.
2008-06-04More type-checking.Ben Laurie
2007-09-14Handle empty case in X509_NAME canonical encoding.Dr. Stephen Henson
2007-07-27Respect ISO aliasing rules.Andy Polyakov
PR: 1296
2006-09-22Update length if copying MSB set in asn1_string_canon().Dr. Stephen Henson
2006-07-21Avoid warning.Dr. Stephen Henson
2006-07-18Store canonical encodings of Name structures. Update X509_NAME_cmp() to useDr. Stephen Henson
them.
2005-09-01Return 2 from X509_NAME printing routine to add newline.Dr. Stephen Henson
2005-09-01Initial support for ASN1 print code.Dr. Stephen Henson
WARNING WARNING WARNING, experimental code, handle with care, use at your own risk, may contain nuts.
2005-05-11Fix more error codes.Bodo Möller
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
2005-01-27Get rid if the annoying warningRichard Levitte
2004-03-15Constify d2i, s2i, c2i and r2i functions and other associatedRichard Levitte
functions and macros. This change has associated tags: LEVITTE_before_const and LEVITTE_after_const. Those will be removed when this change has been properly reviewed.
2001-07-27More linker bloat reorganisation:Dr. Stephen Henson
Split private key PEM and normal PEM handling. Private key handling needs to link in stuff like PKCS#8. Relocate the ASN1 *_dup() functions, to the relevant ASN1 modules using new macro IMPLEMENT_ASN1_DUP_FUNCTION. Previously these were all in crypto/x509/x_all.c along with every ASN1 BIO/fp function which linked in *every* ASN1 function if a single dup was used. Move the authority key id ASN1 structure to a separate file. This is used in the X509 routines and its previous location linked in all the v3 extension code. Also move ASN1_tag2bit to avoid linking in a_bytes.c which is now largely obsolete. So far under Linux stripped binary with single PEM_read_X509 is now 238K compared to 380K before these changes.
2001-03-05New option '-subj arg' for 'openssl req' and 'openssl ca'. ThisBodo Möller
sets the subject name for a new request or supersedes the subject name in a given request. Add options '-batch' and '-verbose' to 'openssl req'. Submitted by: Massimiliano Pala <madwolf@hackmasters.net> Reviewed by: Bodo Moeller
2001-02-23Get rid of ASN1_ITEM_FUNCTIONS dummy functionDr. Stephen Henson
prototype hack. This unfortunately means that every ASN1_*_END construct cannot have a trailing ;
2001-02-23Initial support for ASN1_ITEM_FUNCTION option toDr. Stephen Henson
change the way ASN1 modules are exported. Still needs a bit of work for example the hack which a dummy function prototype to avoid compilers warning about multiple ;s.
2001-01-11Fix typo in OCSP ASN1 module, this causedDr. Stephen Henson
invalid format in OCSP request signatures. Add spaces to OCSP HTTP header. Change X509_NAME_set() there's no reason why it should return an error if the destination points to NULL... though it should if the destination is NULL.
2000-12-08Merge from the ASN1 branch of new ASN1 codeDr. Stephen Henson
to main trunk. Lets see if the makes it to openssl-cvs :-)
2000-06-01There have been a number of complaints from a number of sources that namesRichard Levitte
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
2000-05-31sk_***_new_null() seems to be there to avoid exactly this sort of thingGeoff Thorpe
which is a cast between NULL and a function pointer.
1999-10-20Replace the macros in asn1.h with function equivalents. Also make UTF8StringsDr. Stephen Henson
tolerated in certificates.
1999-07-21Torture weak compilers less by not automatically including x509.h whereBodo Möller
it is not needed.
1999-05-01Another safe stack.Ben Laurie
1999-04-26Remove NOPROTO definitions and error code comments.Ulf Möller
1999-04-23Change #include filenames from <foo.h> to <openssl.h>.Bodo Möller
Submitted by: Reviewed by: PR:
1999-04-19Change functions to ANSI C.Ulf Möller
1999-01-07Accept NULL in *_free.Ben Laurie
1998-12-21Import of old SSLeay release: SSLeay 0.9.1b (unreleased)SSLeayRalf S. Engelschall
1998-12-21Import of old SSLeay release: SSLeay 0.9.0bRalf S. Engelschall
1998-12-21Import of old SSLeay release: SSLeay 0.8.1bRalf S. Engelschall