summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_cert.c
diff options
context:
space:
mode:
authorjsing <>2018-11-08 20:55:18 +0000
committerjsing <>2018-11-08 20:55:18 +0000
commit282c11bdbc9506966def8e70d943547afeec3c63 (patch)
treea970ddfd423ef6778696482b13ad31cb6984e3f0 /src/lib/libssl/ssl_cert.c
parentd1d568e5589418aecc7cdb33ca2338d20ce7c5d8 (diff)
downloadopenbsd-282c11bdbc9506966def8e70d943547afeec3c63.tar.gz
openbsd-282c11bdbc9506966def8e70d943547afeec3c63.tar.bz2
openbsd-282c11bdbc9506966def8e70d943547afeec3c63.zip
Stop pretending that a cert member in a SSL and SSL_CTX can be NULL.
ok beck@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_cert.c')
-rw-r--r--src/lib/libssl/ssl_cert.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/lib/libssl/ssl_cert.c b/src/lib/libssl/ssl_cert.c
index 567d8ea21f..bfd915d7df 100644
--- a/src/lib/libssl/ssl_cert.c
+++ b/src/lib/libssl/ssl_cert.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_cert.c,v 1.68 2018/11/05 03:49:44 jsing Exp $ */ 1/* $OpenBSD: ssl_cert.c,v 1.69 2018/11/08 20:55:18 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 *
@@ -321,34 +321,6 @@ ssl_cert_free(CERT *c)
321 free(c); 321 free(c);
322} 322}
323 323
324int
325ssl_cert_inst(CERT **o)
326{
327 /*
328 * Create a CERT if there isn't already one
329 * (which cannot really happen, as it is initially created in
330 * SSL_CTX_new; but the earlier code usually allows for that one
331 * being non-existant, so we follow that behaviour, as it might
332 * turn out that there actually is a reason for it -- but I'm
333 * not sure that *all* of the existing code could cope with
334 * s->cert being NULL, otherwise we could do without the
335 * initialization in SSL_CTX_new).
336 */
337
338 if (o == NULL) {
339 SSLerrorx(ERR_R_PASSED_NULL_PARAMETER);
340 return (0);
341 }
342 if (*o == NULL) {
343 if ((*o = ssl_cert_new()) == NULL) {
344 SSLerrorx(ERR_R_MALLOC_FAILURE);
345 return (0);
346 }
347 }
348 return (1);
349}
350
351
352SESS_CERT * 324SESS_CERT *
353ssl_sess_cert_new(void) 325ssl_sess_cert_new(void)
354{ 326{