summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3/v3_lib.c
AgeCommit message (Collapse)Author
2019-05-29Join the x509 and x509v3 directoriesRichard Levitte
This has been long overdue. Note that this does not join the X509 and X509V3 error modules, that will be too many macro changes at this stage. Fixes #8919 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8925)
2018-12-06Following the license change, modify the boilerplates in crypto/x509v3/Richard Levitte
[skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7825)
2018-09-11Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7176)
2018-08-07Harmonize use of sk_TYPE_find's return value.Andy Polyakov
In some cases it's about redundant check for return value, in some cases it's about replacing check for -1 with comparison to 0. Otherwise compiler might generate redundant check for <-1. [Even formatting and readability fixes.] Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6860)
2017-11-10Fix possible leaks on sk_X509_EXTENSION_push() failure ...FdaSilvaYY
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4677)
2016-11-03Convert x509 selftests to internal testRichard Levitte
Reviewed-by: Emilia Käsper <emilia@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1789)
2016-08-16Add ASN1_STRING_get0_data(), deprecate ASN1_STRING_data().Dr. Stephen Henson
Deprecate the function ASN1_STRING_data() and replace with a new function ASN1_STRING_get0_data() which returns a constant pointer. Update library to use new function. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-25Constify (X509|X509V3|X509_CRL|X509_REVOKED)_get_ext_d2i ...FdaSilvaYY
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1300)
2016-05-17Copyright consolidation 07/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-25Add more CT utility routines to be used as part of larger patch.Adam Eijdenberg
Reviewed-by: Ben Laurie <ben@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-10Support the TLS Feature (aka Must Staple) X.509v3 extension (RFC7633).Rob Stradling
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Dr. Stephen Henson <steve@openssl.org> GH: #495, MR: #1435
2015-10-09Initial commit for Certificate Transparency supportAdam Eijdenberg
Original authors: Rob Stradling <rob@comodo.com> Dr. Stephen Henson <steve@openssl.org> Reviewed-by: Emilia Kasper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-11Fix "defined but not used" warnings.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte
There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-11Use p==NULL not !p (in if statements, mainly)Rich Salz
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-04Use safer sizeof variant in mallocRich Salz
For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-28remove malloc castsRich Salz
Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-23make X509_EXTENSION opaqueDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-02-06util/mkstack.pl now generates entire safestack.hRich Salz
The mkstack.pl script now generates the entire safestack.h file. It generates output that follows the coding style. Also, removed all instances of the obsolete IMPLEMENT_STACK_OF macro. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-06Further comment amendments to preserve formatting prior to source reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2008-11-05Update obsolete email address...Dr. Stephen Henson
2008-10-22Create function of the form OBJ_bsearch_xxx() in bsearch typesafe macrosDr. Stephen Henson
with the appropriate parameters which calls OBJ_bsearch(). A compiler will typically inline this. This avoids the need for cmp_xxx variables and fixes unchecked const issues with CHECKED_PTR_OF()
2008-10-12Type-checked (and modern C compliant) OBJ_bsearch.Ben Laurie
2005-05-11Fix more error codes.Bodo Möller
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
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.
2003-05-28PR: 631Dr. Stephen Henson
Submitted by: Doug Sauder <dws+001@hunnysoft.com> Fix bug in X509V3_get_d2i() when idx in not NULL.
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-02-16New options to 'ca' utility to support CRL entry extensions.Dr. Stephen Henson
Add revelant new X509V3 extensions. Add OIDs. Fix ASN1 memory leak code to pop info if external allocation used.
2000-12-27X509V3_add_i2d() needs to be able to allocate aDr. Stephen Henson
STACK_OF(X509_EXTENSION) so it should be passed STACK_OF(X509_EXTENSION) ** in the first argument. Modify wrappers appropriately.
2000-12-24New function X509V3_add_i2d() this is used forDr. Stephen Henson
encoding, replacing and deleting extensions. Fix X509V3_get_d2i() so it uses takes note of new critical behaviour.
2000-12-13Rewrite the extension code to use an ASN1_ITEM structureDr. Stephen Henson
for its ASN1 operations as well as the old style function pointers (i2d, d2i, new, free). Change standard extensions to support this. Fix a warning in BN_mul(), bn_mul.c about uninitialised 'j'.
2000-06-11Document EVP routines. Change EVP_SealInit() and EVP_OpenInit()Dr. Stephen Henson
to support multiple calls. New function to retrieve email address from certificates and requests.
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-06-01The previous commit to crypto/stack/*.[ch] pulled the type-safety stringsGeoff Thorpe
yet tighter, and also put some heat on the rest of the library by insisting (correctly) that compare callbacks used in stacks are prototyped with "const" parameters. This has led to a depth-first explosion of compiler warnings in the code where 1 constification has led to 3 or 4 more. Fortunately these have all been resolved to completion and the code seems cleaner as a result - in particular many of the _cmp() functions should have been prototyped with "const"s, and now are. There was one little problem however; X509_cmp() should by rights compare "const X509 *" pointers, and it is now declared as such. However, it's internal workings can involve recalculating hash values and extensions if they have not already been setup. Someone with a more intricate understanding of the flow control of X509 might be able to tighten this up, but for now - this seemed the obvious place to stop the "depth-first" constification of the code by using an evil cast (they have migrated all the way here from safestack.h). Fortunately, this is the only place in the code where this was required to complete these type-safety changes, and it's reasonably clear and commented, and seemed the least unacceptable of the options. Trying to take the constification further ends up exploding out considerably, and indeed leads directly into generalised ASN functions which are not likely to cooperate well with this.
2000-05-17Typesafety Thought Police last part.Ben Laurie
2000-05-15Get rid of more non-ANSI declarations.Ulf Möller
2000-02-13Modernise 'selfsign.c' to use new X509_NAME codeDr. Stephen Henson
and add example of extension aliasing. Also fix the extension aliasing because it didn't work :-)
2000-02-07Rename the X509V3_*_d2i functions to X509_get_ext_d2i() etc.Dr. Stephen Henson
This better reflects their behaviour.
1999-12-01Modify the X509 V3 extension lookup code.Dr. Stephen Henson
1999-11-27Add trust setting support to the verify code. It now checks theDr. Stephen Henson
trust settings of the root CA. After a few fixes it seems to work OK. Still need to add support to SSL and S/MIME code though.
1999-11-23Support for authority information access extension.Dr. Stephen Henson
Fix so EVP_PKEY_rset_*() check return codes.
1999-10-11Add EX_DATA support to X509.Dr. Stephen Henson
Fix a bug in the X509_get_d2i() functions which didn't check if crit was NULL.
1999-10-09New functions to parse and get extensions.Dr. Stephen Henson
1999-05-23Set ext_list to NULL after use.Dr. Stephen Henson
1999-04-23Change #include filenames from <foo.h> to <openssl.h>.Bodo Möller
Submitted by: Reviewed by: PR:
1999-04-21Suppport for CRL distribution points extension. Also document some ofDr. Stephen Henson
this stuff.
1999-04-20Various fixes so Win32 compile may work. Convert GeneralNames to use safe stack.Dr. Stephen Henson
1999-04-19Change functions to ANSI C.Ulf Möller