summaryrefslogtreecommitdiffstats
path: root/ssl/s3_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-12-26 16:23:13 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-12-26 16:23:13 +0000
commita50ecaee56e8e2ebf14ed122d15578acd2a2aa06 (patch)
treed9ecdabf9936182793739870baf07d710770a9b2 /ssl/s3_lib.c
parent67d9dcf0030fc06b4bb68df0302761123f0d065f (diff)
store and print out message digest peer signed with in TLS 1.2
(backport from HEAD)
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r--ssl/s3_lib.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 964e094da1..177511da68 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -3458,6 +3458,25 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
case SSL_CTRL_SET_CHAIN_CERT_STORE:
return ssl_cert_set_cert_store(s->cert, parg, 1, larg);
+ case SSL_CTRL_GET_PEER_SIGNATURE_NID:
+ if (TLS1_get_version(s) >= TLS1_2_VERSION)
+ {
+ if (s->session && s->session->sess_cert)
+ {
+ const EVP_MD *sig;
+ sig = s->session->sess_cert->peer_key->digest;
+ if (sig)
+ {
+ *(int *)parg = EVP_MD_type(sig);
+ return 1;
+ }
+ }
+ return 0;
+ }
+ /* Might want to do something here for other versions */
+ else
+ return 0;
+
default:
break;
}