1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 01:18:19 +02:00

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.
This commit is contained in:
Jakub Zelenka
2016-08-03 20:01:41 +01:00
parent 8f0baa9707
commit 6822af2e73
+2 -1
View File
@@ -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;