summaryrefslogtreecommitdiffstats
path: root/ssl/t1_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-05-22 12:33:42 +0100
committerMatt Caswell <matt@openssl.org>2017-05-22 14:00:43 +0100
commitb77f3ed17134fe6bf99d143abb1aec3f2bfac555 (patch)
treea69d558f10df0648f0adcfb78a8b11933629879d /ssl/t1_lib.c
parenta89325e41f52b4a1f58202f6d8f5597105fc9f5a (diff)
Convert existing usage of assert() to ossl_assert() in libssl
Provides consistent output and approach. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3496)
Diffstat (limited to 'ssl/t1_lib.c')
-rw-r--r--ssl/t1_lib.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 232bb41fe0..c185a09e9c 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -101,9 +101,11 @@ long tls1_default_timeout(void)
int tls1_new(SSL *s)
{
if (!ssl3_new(s))
- return (0);
- s->method->ssl_clear(s);
- return (1);
+ return 0;
+ if (!s->method->ssl_clear(s))
+ return 0;
+
+ return 1;
}
void tls1_free(SSL *s)
@@ -112,13 +114,17 @@ void tls1_free(SSL *s)
ssl3_free(s);
}
-void tls1_clear(SSL *s)
+int tls1_clear(SSL *s)
{
- ssl3_clear(s);
+ if (!ssl3_clear(s))
+ return 0;
+
if (s->method->version == TLS_ANY_VERSION)
s->version = TLS_MAX_VERSION;
else
s->version = s->method->version;
+
+ return 1;
}
#ifndef OPENSSL_NO_EC