aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509v3/v3_utl.c
AgeCommit message (Collapse)AuthorFilesLines
2015-12-16Rename some BUF_xxx to OPENSSL_xxxRich Salz1-7/+7
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-09Continue standardising malloc style for libcryptoMatt Caswell1-9/+13
Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@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-08-31make X509_REQ opaqueDr. Stephen Henson1-0/+1
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte1-1/+1
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 Salz1-13/+19
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-11Add missing NULL check in X509V3_parse_list()Kurt Cancemi1-0/+4
Matt's note: I added a call to X509V3err to Kurt's original patch. RT#3840 Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-07Fix typo in valid_starViktor Dukhovni1-1/+1
Reviewed-by: Rich Salz <rsalz@akamai.com>
2015-05-06Use "==0" instead of "!strcmp" etcRich Salz1-6/+13
For the various string-compare routines (strcmp, strcasecmp, str.*cmp) use "strcmp()==0" instead of "!strcmp()" Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-04Use safer sizeof variant in mallocRich Salz1-1/+1
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-05-01free null cleanup finaleRich Salz1-16/+8
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-30free NULL cleanup 8Rich Salz1-2/+1
Do not check for NULL before calling a free routine. This addresses: ASN1_BIT_STRING_free ASN1_GENERALIZEDTIME_free ASN1_INTEGER_free ASN1_OBJECT_free ASN1_OCTET_STRING_free ASN1_PCTX_free ASN1_SCTX_free ASN1_STRING_clear_free ASN1_STRING_free ASN1_TYPE_free ASN1_UTCTIME_free M_ASN1_free_of Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-28remove malloc castsRich Salz1-1/+1
Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-02-10Fix hostname validation in the command-line tool to honour negative return ↵Emilia Kasper1-1/+6
values. Specifically, an ASN.1 NumericString in the certificate CN will fail UTF-8 conversion and result in a negative return value, which the "x509 -checkhost" command-line option incorrectly interpreted as success. Also update X509_check_host docs to reflect reality. Thanks to Sean Burford (Google) for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-02-02Dead code cleanup: crypto/*.c, x509v3, demosRich Salz1-12/+0
Some of the #if 0 code in demo's was kept, but given helpful #ifdef names, to show more sample code. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-01-22More comment realignmentmaster-post-reformatMatt Caswell1-5/+5
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell1-1057/+1073
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22More indent fixes for STACK_OFMatt Caswell1-1/+1
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-12Allow multiple IDN xn-- indicatorsRich Salz1-27/+8
Update the X509v3 name parsing to allow multiple xn-- international domain name indicators in a name. Previously, only allowed one at the beginning of a name, which was wrong. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2014-08-15Fix use after free bug.Istvan Noszticzius1-1/+1
Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-07-07Update API to use (char *) for email addresses and hostnamesViktor Dukhovni1-15/+16
Reduces number of silly casts in OpenSSL code and likely most applications. Consistent with (char *) for "peername" value from X509_check_host() and X509_VERIFY_PARAM_get0_peername().
2014-07-06Set optional peername when X509_check_host() succeeds.Viktor Dukhovni1-24/+30
Pass address of X509_VERIFY_PARAM_ID peername to X509_check_host(). Document modified interface.
2014-06-22More complete input validation of X509_check_mumbleViktor Dukhovni1-3/+29
2014-06-22Drop hostlen from X509_VERIFY_PARAM_ID.Viktor Dukhovni1-0/+4
Just store NUL-terminated strings. This works better when we add support for multiple hostnames.
2014-06-14Enforce _X509_CHECK_FLAG_DOT_SUBDOMAINS internal-onlyViktor Dukhovni1-6/+5
2014-06-12Client-side namecheck wildcards.Viktor Dukhovni1-6/+53
A client reference identity of ".example.com" matches a server certificate presented identity that is any sub-domain of "example.com" (e.g. "www.sub.example.com). With the X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS flag, it matches only direct child sub-domains (e.g. "www.sub.example.com").
2014-05-21Fixes to host checking.Viktor Dukhovni1-61/+145
Fixes to host checking wild card support and add support for setting host checking flags when verifying a certificate chain.
2012-11-21Submitted by: Florian Weimer <fweimer@redhat.com>Dr. Stephen Henson1-6/+1
PR: 2909 Update test cases to cover internal error return values. Remove IDNA wildcard filter.
2012-11-18PR: 2909Dr. Stephen Henson1-14/+190
Contributed by: Florian Weimer <fweimer@redhat.com> Fixes to X509 hostname and email address checking. Wildcard matching support. New test program and manual page.
2012-10-08New functions to check a hostname email or IP address against aDr. Stephen Henson1-0/+128
certificate. Add options to s_client, s_server and x509 utilities to print results of checks.
2009-07-27Update from 1.0.0-stableDr. Stephen Henson1-18/+18
2009-02-14PR: 1835Dr. Stephen Henson1-1/+1
Submitted by: Damien Miller <djm@mindrot.org> Approved by: steve@openssl.org Fix various typos.
2008-12-08Oops should check zero_pos >= 0.Dr. Stephen Henson1-1/+1
2008-12-07Handle case where v6stat.zero_pos == 0 correctly.Dr. Stephen Henson1-8/+11
Reported by: Kurt Roeckx <kurt@roeckx.be>, Tobias Ginzler <ginzler@fgan.de> (Debian bug #506111)
2008-11-05Update obsolete email address...Dr. Stephen Henson1-1/+1
2008-07-04Avoid warnings with -pedantic, specifically:Dr. Stephen Henson1-1/+1
Conversion between void * and function pointer. Value computed not used. Signed/unsigned argument.
2008-06-04More type-checking.Ben Laurie1-19/+22
2007-09-26Support for certificate status TLS extension.Dr. Stephen Henson1-0/+24
2007-04-11Constification.Dr. Stephen Henson1-3/+3
2007-02-03Update from fips2 branch.Dr. Stephen Henson1-1/+1
2006-11-27Add RFC 3779 support.Ben Laurie1-2/+1
2006-03-06unused functionUlf Möller1-13/+0
2006-02-12RFC 3161 compliant time stamp request creation, response generationUlf Möller1-0/+13
and response verification. Submitted by: Zoltan Glozik <zglozik@opentsa.org> Reviewed by: Ulf Moeller
2005-07-25Typo which prevents mult valued RDNs being created.Dr. Stephen Henson1-3/+3
2004-05-17Deprecate the recursive includes of bn.h from various API headers (asn1.h,Geoff Thorpe1-0/+1
dh.h, dsa.h, ec.h, ecdh.h, ecdsa.h, rsa.h), as the opaque bignum types are already declared in ossl_typ.h. Add explicit includes for bn.h in those C files that need access to structure internals or API functions+macros.
2003-03-30Multi valued AVA support.Dr. Stephen Henson1-2/+13
2003-03-24Support for name constraints.Dr. Stephen Henson1-12/+68
2003-02-27Support for dirName from config files in GeneralName extensions.Dr. Stephen Henson1-0/+35
2003-02-05IPv6 display and input support for extensions usingh GeneralName.Dr. Stephen Henson1-2/+208
2002-11-14Fix get_email: 0 is a valid return valueDr. Stephen Henson1-1/+1