Skip to content

Commit

Permalink
Use the actual handshake message type in the certificate request hand…
Browse files Browse the repository at this point in the history
…ler.
  • Loading branch information
4a6f656c committed Jan 21, 2019
1 parent 5ceed53 commit 73173f9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/libssl/tls13_handshake.c
@@ -1,4 +1,4 @@
/* $OpenBSD: tls13_handshake.c,v 1.18 2019/01/21 13:45:57 jsing Exp $ */
/* $OpenBSD: tls13_handshake.c,v 1.19 2019/01/21 14:19:51 jsing Exp $ */
/*
* Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Joel Sing <jsing@openbsd.org>
Expand Down Expand Up @@ -509,15 +509,13 @@ tls13_server_certificate_send(struct tls13_ctx *ctx)
int
tls13_server_certificate_request_recv(struct tls13_ctx *ctx)
{
uint8_t msg_type = 0; /* XXX */

/*
* Thanks to poor state design in the RFC, this function can be called
* when we actually have a certificate message instead of a certificate
* request... in that case we call the certificate handler after
* switching state, to avoid advancing state.
*/
if (msg_type == TLS13_MT_CERTIFICATE) {
if (tls13_handshake_msg_type(ctx->hs_msg) == TLS13_MT_CERTIFICATE) {
ctx->handshake_stage.hs_type |= WITHOUT_CR;
return tls13_server_certificate_recv(ctx);
}
Expand Down

0 comments on commit 73173f9

Please sign in to comment.