com php-src: Do not add already added object to the internal OpenSSL table: ext/openssl/openssl.c

From: Date: Wed, 03 Aug 2016 19:01:41 +0000
Subject: com php-src: Do not add already added object to the internal OpenSSL table: ext/openssl/openssl.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93590@lists.php.net to get a copy of this message
Commit: 6822af2e738698aab9fa34ca0c572309960bcd74 Author: Jakub Zelenka <bukka@php.net> Wed, 3 Aug 2016 20:01:41 +0100 Parents: 8f0baa9707063d4ae27f101ac2da2a7c9bdfa8f4 Branches: PHP-7.1 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6822af2e738698aab9fa34ca0c572309960bcd74 Log: Do not add already added object to the internal OpenSSL table This fixes OpenSSL 1.1 where adding object with OID that has been already added causes an error - preventing of duplication. Changed paths: M ext/openssl/openssl.c Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index d41ba73..1deb01d 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1017,7 +1017,8 @@ static int add_oid_section(struct php_x509_request * req) /* {{{ */ } for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) { cnf = sk_CONF_VALUE_value(sktmp, i); - if (OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) { + if (OBJ_sn2nid(cnf->name) == NID_undef && OBJ_ln2nid(cnf->name) == NID_undef && + OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) { php_openssl_store_errors(); php_error_docref(NULL, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value); return FAILURE;

« previous php.cvs (#93590) next »