Skip to content

Commit

Permalink
relax is_gost while in auto mode and no certs found
Browse files Browse the repository at this point in the history
  • Loading branch information
deemru committed Dec 19, 2024
1 parent 50b653f commit f695740
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/gostssl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,10 @@ static BOOL CertHasUsage( PCCERT_CONTEXT pcert, const char * oid )

void gostssl_clientcertshook( char *** certs, int ** lens, wchar_t *** names, int * count, int * is_gost )
{
*is_gost = 1;
*is_gost = g_tlsmode == 1 ? 1 : 0;
*count = 0;

if( g_tlsmode == -1 )
if( g_tlsmode == -1 || !gostssl_init() )
{
*is_gost = 0;
return;
Expand All @@ -843,11 +843,7 @@ void gostssl_clientcertshook( char *** certs, int ** lens, wchar_t *** names, in
HCERTSTORE hStore = CertOpenStore( CERT_STORE_PROV_SYSTEM_A, 0, 0, CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_CURRENT_USER, "MY" );

if( !hStore )
{
if( g_tlsmode != 1 )
*is_gost = 0;
return;
}

int i = 0;
g_certs.clear();
Expand Down Expand Up @@ -900,6 +896,7 @@ void gostssl_clientcertshook( char *** certs, int ** lens, wchar_t *** names, in
if( names )
*names = &g_certnames[0];
*count = i;
*is_gost = 1;
}

CertCloseStore( hStore, 0 );
Expand Down

0 comments on commit f695740

Please sign in to comment.