diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-07-08 14:22:45 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-07-08 14:22:45 +0000 |
commit | 9f27b1eec3175305e62eed87faa80e231f319ca0 (patch) | |
tree | a75f48bb0f03a151081bdad6c7da0b1ae3777921 /ssl/ssl_cert.c | |
parent | 9fd603be07f4d486ad38fb107288731743e945be (diff) |
Add new ctrl to retrieve client certificate types, print out
details in s_client.
Also add ctrl to set client certificate types. If not used sensible values
will be included based on supported signature algorithms: for example if
we don't include any DSA signing algorithms the DSA certificate type is
omitted.
Fix restriction in old code where certificate types would be truncated
if it exceeded TLS_CT_NUMBER.
Diffstat (limited to 'ssl/ssl_cert.c')
-rw-r--r-- | ssl/ssl_cert.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 1edbf18f3b..59a8544431 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -388,6 +388,15 @@ CERT *ssl_cert_dup(CERT *cert) ret->client_sigalgs = NULL; /* Shared sigalgs also NULL */ ret->shared_sigalgs = NULL; + /* Copy any custom client certificate types */ + if (cert->ctypes) + { + ret->ctypes = OPENSSL_malloc(cert->ctype_num); + if (!ret->ctypes) + goto err; + memcpy(ret->ctypes, cert->ctypes, cert->ctype_num); + ret->ctype_num = cert->ctype_num; + } ret->cert_flags = cert->cert_flags; @@ -489,6 +498,8 @@ void ssl_cert_free(CERT *c) OPENSSL_free(c->client_sigalgs); if (c->shared_sigalgs) OPENSSL_free(c->shared_sigalgs); + if (c->ctypes) + OPENSSL_free(c->ctypes); OPENSSL_free(c); } |