diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-07-18 17:39:46 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-07-18 17:39:46 +0000 |
commit | 53e7985c8d22cbde9f1b89dab5d78192671448ec (patch) | |
tree | 53501895e6d081c19804637b4781c4e908bd2b8e /ssl/t1_enc.c | |
parent | 9102342795152852468fe0a597e5ae63c6fdb178 (diff) |
PR: 1830
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>, Steve Henson
Support for RFC5705 key extractor.
Diffstat (limited to 'ssl/t1_enc.c')
-rw-r--r-- | ssl/t1_enc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 5446bb250d..3614b8a30e 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -1071,3 +1071,26 @@ int tls1_alert_code(int code) } } +int SSL_tls1_key_exporter(SSL *s, unsigned char *label, int label_len, + unsigned char *context, int context_len, + unsigned char *out, int olen) + { + unsigned char *tmp; + int rv; + + tmp = OPENSSL_malloc(olen); + + if (!tmp) + return 0; + + rv = tls1_PRF(s->s3->tmp.new_cipher->algorithm2, + label, label_len, + s->s3->client_random,SSL3_RANDOM_SIZE, + s->s3->server_random,SSL3_RANDOM_SIZE, + context, context_len, NULL, 0, + s->session->master_key, s->session->master_key_length, + out, tmp, olen); + + OPENSSL_free(tmp); + return rv; + } |