summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_enc.c
diff options
context:
space:
mode:
authorjsing <>2020-03-13 16:40:42 +0000
committerjsing <>2020-03-13 16:40:42 +0000
commit392ee6d491e597c1f18e21334e3cb7998133074e (patch)
tree58f87656681e6786b7b16935eb8b009442a64c49 /src/lib/libssl/t1_enc.c
parente4aa84e84fe680f7d36c8937f3d398c2e44b9d6e (diff)
downloadopenbsd-392ee6d491e597c1f18e21334e3cb7998133074e.tar.gz
openbsd-392ee6d491e597c1f18e21334e3cb7998133074e.tar.bz2
openbsd-392ee6d491e597c1f18e21334e3cb7998133074e.zip
Remove dtls1_enc().
Like much of the original DTLS code, dtls1_enc() is effectively a renamed copy of tls1_enc(). Since then tls1_enc() has been modified, however the non-AEAD code remains largely the same. As such, remove dtls1_enc() and instead call tls1_enc() from the DTLS code. The tls1_enc() AEAD code does not currently work correctly with DTLS, however this is a non-issue since we do not support AEAD cipher suites with DTLS currently. ok tb@
Diffstat (limited to 'src/lib/libssl/t1_enc.c')
-rw-r--r--src/lib/libssl/t1_enc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c
index 347d34d455..177ee061ed 100644
--- a/src/lib/libssl/t1_enc.c
+++ b/src/lib/libssl/t1_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t1_enc.c,v 1.120 2020/03/12 17:09:02 jsing Exp $ */ 1/* $OpenBSD: t1_enc.c,v 1.121 2020/03/13 16:40:42 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -341,13 +341,16 @@ tls1_change_cipher_state_aead(SSL *s, char is_read, const unsigned char *key,
341 const EVP_AEAD *aead = S3I(s)->tmp.new_aead; 341 const EVP_AEAD *aead = S3I(s)->tmp.new_aead;
342 SSL_AEAD_CTX *aead_ctx; 342 SSL_AEAD_CTX *aead_ctx;
343 343
344 /* XXX - Need to avoid clearing write state for DTLS. */
345 if (SSL_IS_DTLS(s))
346 return 0;
347
344 if (is_read) { 348 if (is_read) {
345 ssl_clear_cipher_read_state(s); 349 ssl_clear_cipher_read_state(s);
346 if (!tls1_aead_ctx_init(&s->internal->aead_read_ctx)) 350 if (!tls1_aead_ctx_init(&s->internal->aead_read_ctx))
347 return 0; 351 return 0;
348 aead_ctx = s->internal->aead_read_ctx; 352 aead_ctx = s->internal->aead_read_ctx;
349 } else { 353 } else {
350 /* XXX - Need to correctly handle DTLS. */
351 ssl_clear_cipher_write_state(s); 354 ssl_clear_cipher_write_state(s);
352 if (!tls1_aead_ctx_init(&s->internal->aead_write_ctx)) 355 if (!tls1_aead_ctx_init(&s->internal->aead_write_ctx))
353 return 0; 356 return 0;