diff options
author | jsing <> | 2021-10-23 08:34:36 +0000 |
---|---|---|
committer | jsing <> | 2021-10-23 08:34:36 +0000 |
commit | 3781592d1cd8ce107960abb543e4eccf20288a82 (patch) | |
tree | 84ea9950c0cb3d3c14ebfccb65a931db3ba71bfd /src/lib/libssl/dtls_locl.h | |
parent | 5ee33af93b944cb8cf535f155eb2a489305b5ccc (diff) | |
download | openbsd-3781592d1cd8ce107960abb543e4eccf20288a82.tar.gz openbsd-3781592d1cd8ce107960abb543e4eccf20288a82.tar.bz2 openbsd-3781592d1cd8ce107960abb543e4eccf20288a82.zip |
Untangle ssl3_get_message() return values.
This function currently has a long return type that may be <= 0 on
error/retry (which is then cast to an int in order to return it up the
stack), or it returns the length of the handshake message (on success).
This obviously means that 0 can be returned for both success and failure,
which is the reason why a separate 'ok' argument has to exist.
Untangle this mess by changing the return value to an int that indicates
success (1) or error/retry (<= 0). The length never needs to actually be
returned as it is already stored in s->internal->init_num (which is where
the return value is read from anyway).
ok tb@
Diffstat (limited to 'src/lib/libssl/dtls_locl.h')
-rw-r--r-- | src/lib/libssl/dtls_locl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libssl/dtls_locl.h b/src/lib/libssl/dtls_locl.h index 4cf8827ec3..306fab2559 100644 --- a/src/lib/libssl/dtls_locl.h +++ b/src/lib/libssl/dtls_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dtls_locl.h,v 1.7 2021/09/04 14:24:28 jsing Exp $ */ | 1 | /* $OpenBSD: dtls_locl.h,v 1.8 2021/10/23 08:34:36 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -223,7 +223,7 @@ void dtls1_free(SSL *s); | |||
223 | void dtls1_clear(SSL *s); | 223 | void dtls1_clear(SSL *s); |
224 | long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg); | 224 | long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg); |
225 | 225 | ||
226 | long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok); | 226 | int dtls1_get_message(SSL *s, int st1, int stn, int mt, long max); |
227 | int dtls1_get_record(SSL *s); | 227 | int dtls1_get_record(SSL *s); |
228 | 228 | ||
229 | __END_HIDDEN_DECLS | 229 | __END_HIDDEN_DECLS |