diff options
author | jsing <> | 2020-05-10 14:17:48 +0000 |
---|---|---|
committer | jsing <> | 2020-05-10 14:17:48 +0000 |
commit | 2c5bb57394ae3bd0d749e60f9e5489396e6f7d75 (patch) | |
tree | b66a408927dda1a4853152273bf1767b1576d8e2 /src/lib/libssl/t1_lib.c | |
parent | 460f8be5c360d203bab35f98b05092261d9701b0 (diff) | |
download | openbsd-2c5bb57394ae3bd0d749e60f9e5489396e6f7d75.tar.gz openbsd-2c5bb57394ae3bd0d749e60f9e5489396e6f7d75.tar.bz2 openbsd-2c5bb57394ae3bd0d749e60f9e5489396e6f7d75.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 'src/lib/libssl/t1_lib.c')
-rw-r--r-- | src/lib/libssl/t1_lib.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c index b265ea089f..fc828541cd 100644 --- a/src/lib/libssl/t1_lib.c +++ b/src/lib/libssl/t1_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: t1_lib.c,v 1.165 2020/03/10 17:02:21 jsing Exp $ */ | 1 | /* $OpenBSD: t1_lib.c,v 1.166 2020/05/10 14:17:48 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 | * |
@@ -717,12 +717,11 @@ ssl_check_serverhello_tlsext(SSL *s) | |||
717 | if ((s->tlsext_status_type != -1) && !(s->internal->tlsext_status_expected) && | 717 | if ((s->tlsext_status_type != -1) && !(s->internal->tlsext_status_expected) && |
718 | s->ctx && s->ctx->internal->tlsext_status_cb) { | 718 | s->ctx && s->ctx->internal->tlsext_status_cb) { |
719 | int r; | 719 | int r; |
720 | /* Set resp to NULL, resplen to -1 so callback knows | 720 | |
721 | * there is no response. | ||
722 | */ | ||
723 | free(s->internal->tlsext_ocsp_resp); | 721 | free(s->internal->tlsext_ocsp_resp); |
724 | s->internal->tlsext_ocsp_resp = NULL; | 722 | s->internal->tlsext_ocsp_resp = NULL; |
725 | s->internal->tlsext_ocsp_resplen = -1; | 723 | s->internal->tlsext_ocsp_resp_len = 0; |
724 | |||
726 | r = s->ctx->internal->tlsext_status_cb(s, | 725 | r = s->ctx->internal->tlsext_status_cb(s, |
727 | s->ctx->internal->tlsext_status_arg); | 726 | s->ctx->internal->tlsext_status_arg); |
728 | if (r == 0) { | 727 | if (r == 0) { |