From f3e1ffb121b4c50286aa7d9dba859b9df537cf86 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 28 Nov 2018 09:32:28 +0100 Subject: [PATCH] Fix #4764: Second try, use X509_STORE_CTX_set_purpose --- libfreerdp/crypto/crypto.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libfreerdp/crypto/crypto.c b/libfreerdp/crypto/crypto.c index f24bfeea3..708651f82 100644 --- a/libfreerdp/crypto/crypto.c +++ b/libfreerdp/crypto/crypto.c @@ -756,7 +756,6 @@ char* crypto_cert_issuer(X509* xcert) BOOL x509_verify_certificate(CryptoCert cert, char* certificate_store_path) { - int purpose; X509_VERIFY_PARAM* verify_param; X509_STORE_CTX* csc; BOOL status = FALSE; @@ -802,13 +801,7 @@ BOOL x509_verify_certificate(CryptoCert cert, char* certificate_store_path) if (!X509_STORE_CTX_init(csc, cert_ctx, xcert, cert->px509chain)) goto end; - purpose = X509_PURPOSE_ANY; - verify_param = X509_STORE_CTX_get0_param(csc); - - if (!verify_param) - goto end; - - X509_VERIFY_PARAM_set_purpose(verify_param, purpose); + X509_STORE_CTX_set_purpose(csc, X509_PURPOSE_SSL_SERVER); if (X509_verify_cert(csc) == 1) status = TRUE;