diff options
author | Ben Laurie <ben@openssl.org> | 2011-12-02 16:49:32 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2011-12-02 16:49:32 +0000 |
commit | a0cf79e841e4e1ee22f9a2c5f3b4f2e113db2c19 (patch) | |
tree | 8c933bd0c5d947c84f7f238672420a6b1cbdc005 /ssl/t1_enc.c | |
parent | 825e1a7c56c5a03efcdba63ac9f0f348037bf02f (diff) |
Fix exporter.
Diffstat (limited to 'ssl/t1_enc.c')
-rw-r--r-- | ssl/t1_enc.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 53341eeb34..b4aa67ee90 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -1250,23 +1250,32 @@ 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) +int SSL_tls1_key_exporter(SSL *s, + const unsigned char *label, int label_len, + const unsigned char *context, int context_len, + unsigned char *out, int olen) { unsigned char *tmp; int rv; + unsigned char context_len_16[2]; + + if (context_len > 0xffff) + return 0; tmp = OPENSSL_malloc(olen); if (!tmp) return 0; + + context_len_16[0] = context_len >> 8; + context_len_16[1] = context_len; rv = tls1_PRF(ssl_get_algorithm2(s), label, label_len, s->s3->client_random,SSL3_RANDOM_SIZE, s->s3->server_random,SSL3_RANDOM_SIZE, - context, context_len, NULL, 0, + context_len_16, sizeof(context_len_16), + context, context_len, s->session->master_key, s->session->master_key_length, out, tmp, olen); |