summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3
AgeCommit message (Collapse)Author
2018-08-17x509v3/v3_purp.c: resolve Thread Sanitizer nit.Andy Polyakov
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6916) (cherry picked from commit 0da7358b0757fa35f2c3a8f51fa036466ae50fd7) Resolved conflicts: crypto/x509v3/v3_purp.c
2018-08-14Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6955)
2018-05-03v3_purp.c: add locking to x509v3_cache_extensions()Dr. Matthias St. Pierre
Fixes #6121 Thanks to Mingtao Yang for reporting this bug. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6164)
2018-03-27Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-21X509V3_EXT_add_nconf_sk, X509v3_add_ext: fix errors handlingPavel Kopyl
X509v3_add_ext: free 'sk' if the memory pointed to by it was malloc-ed inside this function. X509V3_EXT_add_nconf_sk: return an error if X509v3_add_ext() fails. This prevents use of a freed memory in do_body:sk_X509_EXTENSION_num(). Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4896)
2017-12-08Standardize syntax around sizeof(foo)Rich Salz
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4875)
2017-11-16Fix possible leaks on sk_X509_EXTENSION_push() failure ...FdaSilvaYY
Backport of #4677 / 1687aa760cdd164b12c5b70e65cadcbce1e7ccfa Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4715)
2017-11-13Resolve warnings in VC-WIN32 build, which allows to add /WX.Andy Polyakov
It's argued that /WX allows to keep better focus on new code, which motivates its comeback... Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4718)
2017-10-26Don't use strcasecmp and strncasecmp for IA5 stringsMatt Caswell
The functions strcasecmp() and strncasecmp() will use locale specific rules when performing comparison. This could cause some problems in certain locales. For example in the Turkish locale an 'I' character is not the uppercase version of 'i'. However IA5 strings should not use locale specific rules, i.e. for an IA5 string 'I' is uppercase 'i' even if using the Turkish locale. This fixes a bug in name constraints checking reported by Thomas Pornin (NCCGroup). This is not considered a security issue because it would require both a Turkish locale (or other locale with similar issues) and malfeasance by a trusted name-constrained CA for a certificate to pass name constraints in error. The constraints also have to be for excluded sub-trees which are extremely rare. Failure to match permitted subtrees is a bug, not a vulnerability. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4570)
2017-10-24Fix memory leak in GENERAL_NAME_set0_othername.Xiangyu Bu
CLA: trivial Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4544) (cherry picked from commit 04761b557a53f026630dd5916b2b8522d94579db)
2017-08-28Avoid out-of-bounds readRich Salz
Fixes CVE 2017-3735 Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/4276) (cherry picked from commit b23171744b01e473ebbfd6edad70c1c3825ffbcd)
2017-07-06Avoid possible memleak in X509_policy_check()Richard Levitte
When tree_calculate_user_set() fails, a jump to error failed to deallocate a possibly allocated |auth_nodes|. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3851)
2017-05-02Fix some error path logic in i2v_AUTHORITY_INFO_ACCESS and i2v_GENERAL_NAMEMatt Caswell
Fixes #1653 reported by Guido Vranken Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3362) (cherry picked from commit 75a3e39288feeeefde5ed1f96ff9faeba0d2b233)
2017-03-31Fix for #2730. Add CRLDP extension to list of supported extensionsJon Spillett
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3087) (cherry picked from commit e6f648fd880369e186039501c960809b17f96e88)
2017-03-15Fixed a crash in print_notice.Bernd Edlinger
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2935) (cherry picked from commit 29d1fad78899e5ae2997b19937a175784b21c996)
2017-02-05Fix a crash with malformed user notice policy numbersBernd Edlinger
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2352) (cherry picked from commit fe4075f25962dbd302d856c11ac47adb84edc9ca)
2016-08-19Fix NULL-return checks in 1.0.2Rich Salz
RT4386: Add sanity checks for BN_new() RT4384: Missing Sanity Checks for RSA_new_method() RT4384: Missing Sanity Check plus potential NULL pointer deref RT4382: Missing Sanity Check(s) for BUF_strdup() RT4380: Missing Sanity Checks for EVP_PKEY_new() RT4377: Prevent potential NULL pointer dereference RT4375: Missing sanity checks for OPENSSL_malloc() RT4374: Potential for NULL pointer dereferences RT4371: Missing Sanity Check for malloc() RT4370: Potential for NULL pointer dereferences Also expand tabs, make update, typo fix (rsalz) Minor tweak by Paul Dale. Some minor internal review feedback. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-06-10Fix an error path leak in do_ext_nconf()Matt Caswell
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 8605abf13523579ecab8b1f2a4bcb8354d94af79)
2016-05-19Ensure verify error is set when X509_verify_cert() failsViktor Dukhovni
Set ctx->error = X509_V_ERR_OUT_OF_MEM when verificaiton cannot continue due to malloc failure. Similarly for issuer lookup failures and caller errors (bad parameters or invalid state). Also, when X509_verify_cert() returns <= 0 make sure that the verification status does not remain X509_V_OK, as a last resort set it it to X509_V_ERR_UNSPECIFIED, just in case some code path returns an error without setting an appropriate value of ctx->error. Add new and some missing error codes to X509 error -> SSL alert switch. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-01-15NGX-2040 - fix wildcard match on punycode/IDNA DNS namesZi Lin
- bugfix: should not treat '--' as invalid domain substring. - '-' should not be the first letter of a domain Signed-off-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-18Remove the "eay" c-file-style indicatorsRichard Levitte
Since we don't use the eay style any more, there's no point tryint to tell emacs to use it. Reviewed-by: Ben Laurie <ben@openssl.org>
2015-11-09Fix missing malloc return value checksMatt Caswell
During work on a larger change in master a number of locations were identified where return value checks were missing. This backports the relevant fixes. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-15Fix self signed handling.Dr. Stephen Henson
Don't mark a certificate as self signed if keyUsage is present and certificate signing not asserted. PR#3979 Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit f51e5ed6b4b91d12228da873db72aa28109d1797)
2015-09-15RT4044: Remove .cvsignore files.Rich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-09-15d2i: don't update input pointer on failureKurt Roeckx
Reviewed-by: Dr. Stephen Henson <steve@openssl.org> MR #1005 (cherry picked from commit a46c9789ce2aecedceef119e9883513c7a49f1ca)
2015-09-02Cleaner handling of "cnid" in do_x509_checkViktor Dukhovni
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> (cherry picked from commit fffc2faeb2b5cad4516cc624352d445284aa7522)
2015-07-14Conversion to UTF-8 where neededRichard Levitte
This leaves behind files with names ending with '.iso-8859-1'. These should be safe to remove. If something went wrong when re-encoding, there will be some files with names ending with '.utf8' left behind. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-03make updateDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-23Fix the update target and remove duplicate file updatesRichard Levitte
We had updates of certain header files in both Makefile.org and the Makefile in the directory the header file lived in. This is error prone and also sometimes generates slightly different results (usually just a comment that differs) depending on which way the update was done. This removes the file update targets from the top level Makefile, adds an update: target in all Makefiles and has it depend on the depend: or local_depend: targets, whichever is appropriate, so we don't get a double run through the whole file tree. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 0f539dc1a2f45580435c39dada44dd276e79cb88) Conflicts: Makefile.org apps/Makefile test/Makefile
2015-05-11Add missing NULL check in X509V3_parse_list()Kurt Cancemi
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> (cherry picked from commit 344c271eb339fc2982e9a3584a94e51112d84584)
2015-05-07Fix typo in valid_starViktor Dukhovni
Reviewed-by: Rich Salz <rsalz@akamai.com>
2015-05-05Remove libcrypto to libssl dependencyMatt Caswell
Remove dependency on ssl_locl.h from v3_scts.c, and incidentally fix a build problem with kerberos (the dependency meant v3_scts.c was trying to include krb5.h, but without having been passed the relevanant -I flags to the compiler) Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit d13bd6130bd856e9f512c43499e5fc70943bf133) Conflicts: crypto/x509v3/v3_scts.c
2015-04-16Code style: space after 'if'Viktor Dukhovni
Reviewed-by: Matt Caswell <gitlab@openssl.org>
2015-04-11do_dirname: Don't change gen on failuresKurt Roeckx
It would set gen->d.dirn to a freed pointer in case X509V3_NAME_from_section failed. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 8ec5c5dd361343d9017eff8547b19e86e4944ebc)
2015-03-12Fix missing return checks in v3_cpols.cMatt Caswell
Fixed assorted missing return value checks in c3_cpols.c Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit c5f2b5336ab72e40ab91e2ca85639f51fa3178c6)
2015-02-10Fix hostname validation in the command-line tool to honour negative return ↵Emilia Kasper
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> (cherry picked from commit 0923e7df9eafec6db9c75405d7085ec8581f01bd)
2015-01-22Re-align some comments after running the reformat script.OpenSSL_1_0_2-post-reformatMatt Caswell
This should be a one off operation (subsequent invokation of the script should not move them) This commit is for the 1.0.2 changes Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22More indent fixes for STACK_OFMatt Caswell
Conflicts: ssl/s3_lib.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Additional comment changes for reformat of 1.0.2Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Further comment amendments to preserve formatting prior to source reformatMatt Caswell
(cherry picked from commit 4a7fa26ffd65bf36beb8d1cb8f29fc0ae203f5c5) Conflicts: crypto/x509v3/pcy_tree.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22mark all block comments that need format preserving so thatTim Hudson
indent will not alter them when reformatting comments (cherry picked from commit 1d97c8435171a7af575f73c526d79e1ef0ee5960) Conflicts: crypto/bn/bn_lcl.h crypto/bn/bn_prime.c crypto/engine/eng_all.c crypto/rc4/rc4_utl.c crypto/sha/sha.h ssl/kssl.c ssl/t1_lib.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-12Allow multiple IDN xn-- indicatorsRich Salz
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> (cherry picked from commit 31d1d3741f16bd80ec25f72dcdbf6bbdc5664374)
2015-01-06RT3662: Allow leading . in nameConstraintsDr. Stephen Henson
Change by SteveH from original by John Denker (in the RT) Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 77ff1f3b8bfaa348956c5096a2b829f2e767b4f1)
2014-09-08RT3031: Need to #undef some names for win32Robin Lee
Copy the ifdef/undef stanza from x509.h to x509v3.h Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit 83e4e03eeb22d2fbaec516a466330f2ccab22864)
2014-08-15Fix use after free bug.Istvan Noszticzius
Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 5afa57fb7b17aa51cfba1ffa94e900fc7a5f0e04)
2014-07-07Update API to use (char *) for email addresses and hostnamesViktor Dukhovni
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(). (cherry picked from commit 297c67fcd817ea643de2fdeff4e434b050d571e2)
2014-07-07Set optional peername when X509_check_host() succeeds.Viktor Dukhovni
Pass address of X509_VERIFY_PARAM_ID peername to X509_check_host(). Document modified interface. (cherry picked from commit ced3d9158a7a8c676be504bb6cd3b5ffb7cc7f13)
2014-06-25More complete input validation of X509_check_mumbleViktor Dukhovni
(cherry picked from commit 29edebe95c2a51470c78c7e769c926719965eeb1)
2014-06-25Drop hostlen from X509_VERIFY_PARAM_ID.Viktor Dukhovni
Just store NUL-terminated strings. This works better when we add support for multiple hostnames. (cherry picked from commit b3012c698a086937319ed413a113ed7bec1edd1a)