diff options
| author | jsing <> | 2014-05-25 13:27:38 +0000 |
|---|---|---|
| committer | jsing <> | 2014-05-25 13:27:38 +0000 |
| commit | a26ab58294e030cd16e09f09139a602c114d495e (patch) | |
| tree | 1981463f492523e729cbfd564646012bb0a6574c /src/lib/libssl/t1_enc.c | |
| parent | 4742830abc4156a69bf5e7e604c4087367c1ffb1 (diff) | |
| download | openbsd-a26ab58294e030cd16e09f09139a602c114d495e.tar.gz openbsd-a26ab58294e030cd16e09f09139a602c114d495e.tar.bz2 openbsd-a26ab58294e030cd16e09f09139a602c114d495e.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 '')
| -rw-r--r-- | src/lib/libssl/t1_enc.c | 13 |
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 | ||
