Set reference count earlier

Backport of 0e04674e96

Reviewed-by: Steve Henson <steve@openssl.org>

RT #4047, #4110, MR #1356
This commit is contained in:
Kurt Roeckx
2015-11-23 00:07:28 +01:00
parent 943c4ca62b
commit 3a9328e3f7
2 changed files with 2 additions and 2 deletions

View File

@@ -227,6 +227,7 @@ CERT *ssl_cert_dup(CERT *cert)
memset(ret, 0, sizeof(CERT));
ret->references = 1;
ret->key = &ret->pkeys[cert->key - &cert->pkeys[0]];
/*
* or ret->key = ret->pkeys + (cert->key - cert->pkeys), if you find that
@@ -325,7 +326,6 @@ CERT *ssl_cert_dup(CERT *cert)
#endif
}
ret->references = 1;
/*
* Set digests to defaults. NB: we don't copy existing values as they
* will be set during handshake.