summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_enc.c
diff options
context:
space:
mode:
authorjsing <>2014-05-25 13:27:38 +0000
committerjsing <>2014-05-25 13:27:38 +0000
commitfc3ae41e6c3f587c173aca34af47208c06c01668 (patch)
tree1981463f492523e729cbfd564646012bb0a6574c /src/lib/libssl/t1_enc.c
parent272e873b19ba05dbb966cb20a3fa0ca5533b84e2 (diff)
downloadopenbsd-fc3ae41e6c3f587c173aca34af47208c06c01668.tar.gz
openbsd-fc3ae41e6c3f587c173aca34af47208c06c01668.tar.bz2
openbsd-fc3ae41e6c3f587c173aca34af47208c06c01668.zip
The ssl_ciper_get_evp() function is currently overloaded to also return the
compression associated with the SSL session. Based on one of Adam Langley's chromium diffs, factor out the compression handling code into a separate ssl_cipher_get_comp() function. Rewrite the compression handling code to avoid pointless duplication and so that failures are actually returned to and detectable by the caller. ok miod@
Diffstat (limited to 'src/lib/libssl/t1_enc.c')
-rw-r--r--src/lib/libssl/t1_enc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c
index 2599122078..5f17a4a94a 100644
--- a/src/lib/libssl/t1_enc.c
+++ b/src/lib/libssl/t1_enc.c
@@ -532,12 +532,19 @@ tls1_setup_key_block(SSL *s)
532 int mac_type = NID_undef, mac_secret_size = 0; 532 int mac_type = NID_undef, mac_secret_size = 0;
533 int ret = 0; 533 int ret = 0;
534 534
535
536 if (s->s3->tmp.key_block_length != 0) 535 if (s->s3->tmp.key_block_length != 0)
537 return (1); 536 return (1);
538 537
539 if (!ssl_cipher_get_evp(s->session, &c, &hash, &mac_type, &mac_secret_size, &comp)) { 538 if (!ssl_cipher_get_comp(s->session, &comp)) {
540 SSLerr(SSL_F_TLS1_SETUP_KEY_BLOCK, SSL_R_CIPHER_OR_HASH_UNAVAILABLE); 539 SSLerr(SSL_F_TLS1_SETUP_KEY_BLOCK,
540 SSL_R_CIPHER_COMPRESSION_UNAVAILABLE);
541 return (0);
542 }
543
544 if (!ssl_cipher_get_evp(s->session, &c, &hash, &mac_type,
545 &mac_secret_size)) {
546 SSLerr(SSL_F_TLS1_SETUP_KEY_BLOCK,
547 SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
541 return (0); 548 return (0);
542 } 549 }
543 550