diff options
author | 2020-05-10 14:17:47 +0000 | |
---|---|---|
committer | 2020-05-10 14:17:47 +0000 | |
commit | d875fefd47f9f124550eb48e77679245674fcaf2 (patch) | |
tree | fcfeb9eadf343cff3d2ae0611d3dbbe62c0ab100 /lib/libssl/t1_lib.c | |
parent | Only reset TLS extension state when parsing client hello or server hello. (diff) | |
download | wireguard-openbsd-d875fefd47f9f124550eb48e77679245674fcaf2.tar.xz wireguard-openbsd-d875fefd47f9f124550eb48e77679245674fcaf2.zip |
Use size_t for OCSP response length.
The OCSP response length is currently an integer, which is overloaded with
-1 meaning "unset". Use a size_t for the OCSP response length and infer
unset from the OCSP response being NULL. This makes code more readable,
simpler and less error prone.
ok beck@
Diffstat (limited to 'lib/libssl/t1_lib.c')
-rw-r--r-- | lib/libssl/t1_lib.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libssl/t1_lib.c b/lib/libssl/t1_lib.c index b265ea089ff..fc828541cd4 100644 --- a/lib/libssl/t1_lib.c +++ b/lib/libssl/t1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_lib.c,v 1.165 2020/03/10 17:02:21 jsing Exp $ */ +/* $OpenBSD: t1_lib.c,v 1.166 2020/05/10 14:17:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -717,12 +717,11 @@ ssl_check_serverhello_tlsext(SSL *s) if ((s->tlsext_status_type != -1) && !(s->internal->tlsext_status_expected) && s->ctx && s->ctx->internal->tlsext_status_cb) { int r; - /* Set resp to NULL, resplen to -1 so callback knows - * there is no response. - */ + free(s->internal->tlsext_ocsp_resp); s->internal->tlsext_ocsp_resp = NULL; - s->internal->tlsext_ocsp_resplen = -1; + s->internal->tlsext_ocsp_resp_len = 0; + r = s->ctx->internal->tlsext_status_cb(s, s->ctx->internal->tlsext_status_arg); if (r == 0) { |