Skip to content

Commit

Permalink
Plug a long standing leak in libtls CRL handling
Browse files Browse the repository at this point in the history
X509_STORE_add_crl() does not take ownership of the CRL, it bumps its
refcount. So nulling out the CRL from the stack will leak it.

Issue reported by KS Sreeram, thanks!

ok jsing
  • Loading branch information
tb committed Feb 8, 2022
1 parent 064659c commit 388f2ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/libtls/tls.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: tls.c,v 1.92 2021/10/21 14:31:21 tb Exp $ */
/* $OpenBSD: tls.c,v 1.93 2022/01/25 21:51:24 eric Exp $ */
/*
* Copyright (c) 2014 Joel Sing <[email protected]>
*
Expand Down Expand Up @@ -647,7 +647,6 @@ tls_configure_ssl_verify(struct tls *ctx, SSL_CTX *ssl_ctx, int verify)
tls_set_error(ctx, "failed to add crl");
goto err;
}
xi->crl = NULL;
}
X509_STORE_set_flags(store,
X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
Expand Down

0 comments on commit 388f2ae

Please sign in to comment.