summaryrefslogtreecommitdiff
path: root/lib/libssl/d1_srvr.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2017-03-10 16:03:28 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2017-03-10 16:03:28 +0000
commitc9869203a635418724d21286eb793adb725517bf (patch)
treee8d2587d0def22b12a8dc2346616466c5e03088e /lib/libssl/d1_srvr.c
parent002bcc4ad52001d3b873d26708453c6db69ccda0 (diff)
Remove the handshake digests and related code, replacing remaining uses
with the handshake hash. For now tls1_digest_cached_records() is retained to release the handshake buffer. ok beck@ inoguchi@
Diffstat (limited to 'lib/libssl/d1_srvr.c')
-rw-r--r--lib/libssl/d1_srvr.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/libssl/d1_srvr.c b/lib/libssl/d1_srvr.c
index 508e1317302..605f0a59ad9 100644
--- a/lib/libssl/d1_srvr.c
+++ b/lib/libssl/d1_srvr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_srvr.c,v 1.85 2017/03/05 14:24:12 jsing Exp $ */
+/* $OpenBSD: d1_srvr.c,v 1.86 2017/03/10 16:03:27 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -519,13 +519,23 @@ dtls1_accept(SSL *s)
s->internal->state = SSL3_ST_SR_CERT_VRFY_A;
s->internal->init_num = 0;
- /* We need to get hashes here so if there is
- * a client cert, it can be verified */
- tls1_cert_verify_mac(s,
- NID_md5, &(S3I(s)->tmp.cert_verify_md[0]));
- tls1_cert_verify_mac(s,
- NID_sha1,
- &(S3I(s)->tmp.cert_verify_md[MD5_DIGEST_LENGTH]));
+ /*
+ * We need to get hashes here so if there is
+ * a client cert, it can be verified.
+ */
+ if (S3I(s)->handshake_buffer) {
+ if (!tls1_digest_cached_records(s)) {
+ ret = -1;
+ goto end;
+ }
+ }
+ if (!tls1_handshake_hash_value(s,
+ S3I(s)->tmp.cert_verify_md,
+ sizeof(S3I(s)->tmp.cert_verify_md),
+ NULL)) {
+ ret = -1;
+ goto end;
+ }
}
break;