summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_locl.h
diff options
context:
space:
mode:
authorjsing <>2021-10-23 08:34:36 +0000
committerjsing <>2021-10-23 08:34:36 +0000
commit3781592d1cd8ce107960abb543e4eccf20288a82 (patch)
tree84ea9950c0cb3d3c14ebfccb65a931db3ba71bfd /src/lib/libssl/ssl_locl.h
parent5ee33af93b944cb8cf535f155eb2a489305b5ccc (diff)
downloadopenbsd-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/ssl_locl.h')
-rw-r--r--src/lib/libssl/ssl_locl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index 6a6903d95b..62f874061e 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.360 2021/10/23 08:13:02 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.361 2021/10/23 08:34:36 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 *
@@ -1365,7 +1365,7 @@ int ssl3_send_change_cipher_spec(SSL *s, int state_a, int state_b);
1365int ssl3_do_write(SSL *s, int type); 1365int ssl3_do_write(SSL *s, int type);
1366int ssl3_send_alert(SSL *s, int level, int desc); 1366int ssl3_send_alert(SSL *s, int level, int desc);
1367int ssl3_get_req_cert_types(SSL *s, CBB *cbb); 1367int ssl3_get_req_cert_types(SSL *s, CBB *cbb);
1368long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok); 1368int ssl3_get_message(SSL *s, int st1, int stn, int mt, long max);
1369int ssl3_send_finished(SSL *s, int state_a, int state_b); 1369int ssl3_send_finished(SSL *s, int state_a, int state_b);
1370int ssl3_num_ciphers(void); 1370int ssl3_num_ciphers(void);
1371const SSL_CIPHER *ssl3_get_cipher(unsigned int u); 1371const SSL_CIPHER *ssl3_get_cipher(unsigned int u);