@@ -852,7 +852,7 @@ _mongoc_stream_tls_secure_channel_should_retry(mongoc_stream_t *stream)
852
852
#ifdef MONGOC_HAVE_SCH_CREDENTIALS
853
853
854
854
void *
855
- _mongoc_secure_channel_sch_credentials_new (const mongoc_ssl_opt_t * opt , PCCERT_CONTEXT cert , DWORD enabled_protocols )
855
+ _mongoc_secure_channel_sch_credentials_new (const mongoc_ssl_opt_t * opt , PCCERT_CONTEXT * cert , DWORD enabled_protocols )
856
856
{
857
857
SCH_CREDENTIALS * cred = bson_malloc0 (sizeof (SCH_CREDENTIALS ));
858
858
@@ -889,7 +889,7 @@ _mongoc_secure_channel_sch_credentials_new(const mongoc_ssl_opt_t *opt, PCCERT_C
889
889
890
890
if (cert ) {
891
891
cred -> cCreds = 1 ;
892
- cred -> paCred = & cert ;
892
+ cred -> paCred = cert ;
893
893
}
894
894
895
895
TLS_PARAMETERS tls_parameters ;
@@ -909,7 +909,7 @@ _mongoc_secure_channel_sch_credentials_new(const mongoc_ssl_opt_t *opt, PCCERT_C
909
909
#endif
910
910
911
911
void *
912
- _mongoc_secure_channel_schannel_cred_new (const mongoc_ssl_opt_t * opt , PCCERT_CONTEXT cert , DWORD enabled_protocols )
912
+ _mongoc_secure_channel_schannel_cred_new (const mongoc_ssl_opt_t * opt , PCCERT_CONTEXT * cert , DWORD enabled_protocols )
913
913
{
914
914
SCHANNEL_CRED * cred = bson_malloc0 (sizeof (SCHANNEL_CRED ));
915
915
@@ -945,7 +945,7 @@ _mongoc_secure_channel_schannel_cred_new(const mongoc_ssl_opt_t *opt, PCCERT_CON
945
945
946
946
if (cert ) {
947
947
cred -> cCreds = 1 ;
948
- cred -> paCred = & cert ;
948
+ cred -> paCred = cert ;
949
949
}
950
950
951
951
cred -> grbitEnabledProtocols = enabled_protocols ;
@@ -985,18 +985,15 @@ mongoc_secure_channel_cred_new(const mongoc_ssl_opt_t *opt)
985
985
#ifdef MONGOC_HAVE_SCH_CREDENTIALS
986
986
// SCH_CREDENTIALS is supported in Windows 10 1809 / Server 1809 and later
987
987
if (_mongoc_verify_windows_version (10 , 0 , 17763 , false)) {
988
- cred -> cred = _mongoc_secure_channel_sch_credentials_new (opt , cred -> cert , enabled_protocols );
988
+ cred -> cred = _mongoc_secure_channel_sch_credentials_new (opt , & cred -> cert , enabled_protocols );
989
989
cred -> cred_type = sch_credentials ;
990
- printf ("Using SCH_CREDENTIALS\n" );
991
990
} else {
992
- cred -> cred = _mongoc_secure_channel_schannel_cred_new (opt , cred -> cert , enabled_protocols );
991
+ cred -> cred = _mongoc_secure_channel_schannel_cred_new (opt , & cred -> cert , enabled_protocols );
993
992
cred -> cred_type = schannel_cred ;
994
- printf ("Using SCHANNEL_CREDS\n" );
995
993
}
996
994
#else
997
- cred -> cred = _mongoc_secure_channel_schannel_cred_new (opt , cred -> cert , enabled_protocols );
995
+ cred -> cred = _mongoc_secure_channel_schannel_cred_new (opt , & cred -> cert , enabled_protocols );
998
996
cred -> cred_type = schannel_cred ;
999
- printf ("Using SCHANNEL_CREDS\n" );
1000
997
#endif
1001
998
1002
999
return cred ;
@@ -1097,7 +1094,6 @@ mongoc_stream_tls_secure_channel_new_with_creds(mongoc_stream_t *base_stream,
1097
1094
// Cast signed SECURITY_STATUS to unsigned DWORD. FormatMessage expects DWORD.
1098
1095
char * msg = mongoc_winerr_to_string ((DWORD )sspi_status );
1099
1096
MONGOC_ERROR ("Failed to initialize security context: %s" , msg );
1100
- printf ("Failed to initialize security context: %s\n" , msg );
1101
1097
bson_free (msg );
1102
1098
// Detach the base stream so caller can free.
1103
1099
tls -> base_stream = NULL ;
0 commit comments