diff options
author | Jakub Zelenka <bukka@php.net> | 2016-08-03 20:01:41 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2017-04-27 11:49:24 +0200 |
commit | 09e819736aa13c1b90e0833618aa62731cfbc949 (patch) | |
tree | 49bbd032270975d9933dfb4d033bdf3b9f143b08 | |
parent | 3b77751bb180189b97e7c0062b3012fd433e3cda (diff) | |
download | php-git-09e819736aa13c1b90e0833618aa62731cfbc949.tar.gz |
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.
(cherry picked from commit c0203c0cebcb22b892a6923ca7afc086c96c391c)
-rw-r--r-- | ext/openssl/openssl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index f490677931..1242a80fdb 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1007,7 +1007,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_error_docref(NULL, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value); return FAILURE; } |