diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2015-11-23 00:07:28 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2015-11-24 21:54:38 +0100 |
commit | 3a9328e3f7adfb0e5ccfb5375c98f4ef304f8554 (patch) | |
tree | 774a98c4e6cd7c3f91d43f82e95ef38e5b93fba6 | |
parent | 943c4ca62b3f5a160340d57aecb9413407a06e15 (diff) | |
download | openssl-3a9328e3f7adfb0e5ccfb5375c98f4ef304f8554.tar.gz |
Set reference count earlier
Backport of 0e04674e964b905e67e3d215bcf888932c92765f
Reviewed-by: Steve Henson <steve@openssl.org>
RT #4047, #4110, MR #1356
-rw-r--r-- | ssl/ssl_cert.c | 2 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 93a1eb941a..a73f866cb9 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -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. diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 9ddc591bac..f2071db937 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -307,6 +307,7 @@ SSL *SSL_new(SSL_CTX *ctx) s->options = ctx->options; s->mode = ctx->mode; s->max_cert_list = ctx->max_cert_list; + s->references = 1; if (ctx->cert != NULL) { /* @@ -405,7 +406,6 @@ SSL *SSL_new(SSL_CTX *ctx) if (!s->method->ssl_new(s)) goto err; - s->references = 1; s->server = (ctx->method->ssl_accept == ssl_undefined_function) ? 0 : 1; SSL_clear(s); |