diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-09-08 15:59:51 +0200 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-09-08 15:59:51 +0200 |
commit | 33a8de69dc092285fce9a3db4aae2b0df8852427 (patch) | |
tree | 8aecae0e19eac9a95adbcc2e146b36d7655a5c9f /ssl/s3_lib.c | |
parent | store and print out message digest peer signed with in TLS 1.2 (diff) | |
download | openssl-33a8de69dc092285fce9a3db4aae2b0df8852427.tar.xz openssl-33a8de69dc092285fce9a3db4aae2b0df8852427.zip |
new ctrl to retrive value of received temporary key in server key exchange message, print out details in s_client
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 9484a7648f..f1e703b873 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3477,6 +3477,43 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) else return 0; + case SSL_CTRL_GET_SERVER_TMP_KEY: + if (s->server || !s->session || !s->session->sess_cert) + return 0; + else + { + SESS_CERT *sc; + EVP_PKEY *ptmp; + int rv = 0; + sc = s->session->sess_cert; + if (!sc->peer_rsa_tmp && !sc->peer_dh_tmp + && !sc->peer_ecdh_tmp) + return 0; + ptmp = EVP_PKEY_new(); + if (!ptmp) + return 0; + if (0); +#ifndef OPENSSL_NO_RSA + else if (sc->peer_rsa_tmp) + rv = EVP_PKEY_set1_RSA(ptmp, sc->peer_rsa_tmp); +#endif +#ifndef OPENSSL_NO_DH + else if (sc->peer_dh_tmp) + rv = EVP_PKEY_set1_DH(ptmp, sc->peer_dh_tmp); +#endif +#ifndef OPENSSL_NO_ECDH + else if (sc->peer_ecdh_tmp) + rv = EVP_PKEY_set1_EC_KEY(ptmp, sc->peer_ecdh_tmp); +#endif + if (rv) + { + *(EVP_PKEY **)parg = ptmp; + return 1; + } + EVP_PKEY_free(ptmp); + return 0; + } + default: break; } |