@@ -107,7 +107,7 @@ _mongoc_stream_tls_secure_channel_destroy (mongoc_stream_t *stream)
107
107
* Shutting Down an Schannel Connection
108
108
*/
109
109
110
- TRACE ("shutting down SSL/TLS connection" , NULL );
110
+ TRACE ("%s" , " shutting down SSL/TLS connection" );
111
111
112
112
if (secure_channel -> cred && secure_channel -> ctxt ) {
113
113
SecBufferDesc BuffDesc ;
@@ -164,7 +164,7 @@ _mongoc_stream_tls_secure_channel_destroy (mongoc_stream_t *stream)
164
164
165
165
/* free SSPI Schannel API security context handle */
166
166
if (secure_channel -> ctxt ) {
167
- TRACE ("clear security context handle" , NULL );
167
+ TRACE ("%s" , " clear security context handle" );
168
168
DeleteSecurityContext (& secure_channel -> ctxt -> ctxt_handle );
169
169
bson_free (secure_channel -> ctxt );
170
170
}
@@ -173,7 +173,7 @@ _mongoc_stream_tls_secure_channel_destroy (mongoc_stream_t *stream)
173
173
if (secure_channel -> cred ) {
174
174
/* decrement the reference counter of the credential/session handle */
175
175
/* if the handle was not cached and the refcount is zero */
176
- TRACE ("clear credential handle" , NULL );
176
+ TRACE ("%s" , " clear credential handle" );
177
177
FreeCredentialsHandle (& secure_channel -> cred -> cred_handle );
178
178
bson_free (secure_channel -> cred );
179
179
}
@@ -371,7 +371,7 @@ _mongoc_stream_tls_secure_channel_writev (mongoc_stream_t *stream,
371
371
BSON_ASSERT (secure_channel );
372
372
ENTRY ;
373
373
374
- TRACE ("Trying to write to the server" , NULL );
374
+ TRACE ("%s" , " Trying to write to the server" );
375
375
tls -> timeout_msec = timeout_msec ;
376
376
377
377
TRACE ("count: %d, 0th: %lu" , iovcnt , iov [0 ].iov_len );
@@ -587,7 +587,7 @@ _mongoc_stream_tls_secure_channel_decrypt (
587
587
588
588
/* check if server wants to renegotiate the connection context */
589
589
if (sspi_status == SEC_I_RENEGOTIATE ) {
590
- TRACE ("remote party requests renegotiation" , NULL );
590
+ TRACE ("%s" , " remote party requests renegotiation" );
591
591
}
592
592
/* check if the server closed the connection */
593
593
else if (sspi_status == SEC_I_CONTEXT_EXPIRED ) {
@@ -597,11 +597,11 @@ _mongoc_stream_tls_secure_channel_decrypt (
597
597
598
598
if (!secure_channel -> recv_connection_closed ) {
599
599
secure_channel -> recv_connection_closed = true;
600
- TRACE ("server closed the connection" , NULL );
600
+ TRACE ("%s" , " server closed the connection" );
601
601
}
602
602
}
603
603
} else if (sspi_status == SEC_E_INCOMPLETE_MESSAGE ) {
604
- TRACE ("failed to decrypt data, need more data" , NULL );
604
+ TRACE ("%s" , " failed to decrypt data, need more data" );
605
605
} else {
606
606
TRACE ("failed to read data from server: %d" , sspi_status );
607
607
secure_channel -> recv_unrecoverable_err = true;
@@ -639,7 +639,7 @@ _mongoc_stream_tls_secure_channel_read (mongoc_stream_t *stream,
639
639
*/
640
640
641
641
if (secure_channel -> decdata_offset ) {
642
- TRACE ("decrypted data is already available" , NULL );
642
+ TRACE ("%s" , " decrypted data is already available" );
643
643
return _mongoc_stream_tls_secure_channel_debuf (secure_channel , buf , len );
644
644
}
645
645
@@ -654,17 +654,17 @@ _mongoc_stream_tls_secure_channel_read (mongoc_stream_t *stream,
654
654
655
655
/* keep these checks separated, for more detailed tracing */
656
656
if (secure_channel -> recv_unrecoverable_err ) {
657
- TRACE ("an unrecoverable error occurred in a prior call" , NULL );
657
+ TRACE ("%s" , " an unrecoverable error occurred in a prior call" );
658
658
return -1 ;
659
659
}
660
660
661
661
if (secure_channel -> recv_sspi_close_notify ) {
662
- TRACE ("server indicated shutdown in a prior call" , NULL );
662
+ TRACE ("%s" , " server indicated shutdown in a prior call" );
663
663
return -1 ;
664
664
}
665
665
666
666
if (secure_channel -> recv_connection_closed ) {
667
- TRACE ("connection closed" , NULL );
667
+ TRACE ("%s" , " connection closed" );
668
668
return -1 ;
669
669
}
670
670
@@ -679,7 +679,7 @@ _mongoc_stream_tls_secure_channel_read (mongoc_stream_t *stream,
679
679
680
680
if (!nread ) {
681
681
if (MONGOC_ERRNO_IS_AGAIN (errno )) {
682
- TRACE ("Try again" , NULL );
682
+ TRACE ("%s" , " Try again" );
683
683
return 0 ;
684
684
} else {
685
685
secure_channel -> recv_connection_closed = true;
@@ -836,11 +836,11 @@ mongoc_stream_tls_secure_channel_handshake (mongoc_stream_t *stream,
836
836
837
837
838
838
if (mongoc_secure_channel_handshake_step_1 (tls , (char * ) host )) {
839
- TRACE ("Step#1 Worked!\n\n" , NULL );
839
+ TRACE ("%s" , " Step#1 Worked!\n\n" );
840
840
* events = POLLIN ;
841
841
RETURN (false);
842
842
} else {
843
- TRACE ("Step#1 FAILED!" , NULL );
843
+ TRACE ("%s" , " Step#1 FAILED!" );
844
844
}
845
845
846
846
break ;
@@ -857,25 +857,25 @@ mongoc_stream_tls_secure_channel_handshake (mongoc_stream_t *stream,
857
857
}
858
858
RETURN (false);
859
859
} else {
860
- TRACE ("Step#2 FAILED!" , NULL );
860
+ TRACE ("%s" , " Step#2 FAILED!" );
861
861
}
862
862
863
863
break ;
864
864
865
865
case ssl_connect_3 :
866
866
867
867
if (mongoc_secure_channel_handshake_step_3 (tls , (char * ) host )) {
868
- TRACE ("Step#3 Worked!\n\n" , NULL );
868
+ TRACE ("%s" , " Step#3 Worked!\n\n" );
869
869
* events = POLLIN | POLLOUT ;
870
870
RETURN (false);
871
871
} else {
872
- TRACE ("Step#3 FAILED!" , NULL );
872
+ TRACE ("%s" , " Step#3 FAILED!" );
873
873
}
874
874
875
875
break ;
876
876
877
877
case ssl_connect_done :
878
- TRACE ("Connect DONE!" , NULL );
878
+ TRACE ("%s" , " Connect DONE!" );
879
879
/* reset our connection state machine */
880
880
secure_channel -> connecting_state = ssl_connect_1 ;
881
881
RETURN (true);
@@ -961,7 +961,7 @@ mongoc_stream_tls_secure_channel_new (mongoc_stream_t *base_stream,
961
961
tls -> timeout_msec = -1 ;
962
962
tls -> base_stream = base_stream ;
963
963
964
- TRACE ("SSL/TLS connection with endpoint AcquireCredentialsHandle" , NULL );
964
+ TRACE ("%s" , " SSL/TLS connection with endpoint AcquireCredentialsHandle" );
965
965
966
966
/* setup Schannel API options */
967
967
memset (& schannel_cred , 0 , sizeof (schannel_cred ));
@@ -978,15 +978,15 @@ mongoc_stream_tls_secure_channel_new (mongoc_stream_t *base_stream,
978
978
schannel_cred .dwFlags |= SCH_CRED_MANUAL_CRED_VALIDATION |
979
979
SCH_CRED_IGNORE_NO_REVOCATION_CHECK |
980
980
SCH_CRED_IGNORE_REVOCATION_OFFLINE ;
981
- TRACE ("disabled server certificate checks" , NULL );
981
+ TRACE ("%s" , " disabled server certificate checks" );
982
982
} else if (_mongoc_ssl_opts_disable_certificate_revocation_check (opt )) {
983
983
schannel_cred .dwFlags |= SCH_CRED_IGNORE_NO_REVOCATION_CHECK |
984
984
SCH_CRED_IGNORE_REVOCATION_OFFLINE ;
985
- TRACE ("disabled server certificate revocation checks" , NULL );
985
+ TRACE ("%s" , " disabled server certificate revocation checks" );
986
986
} else {
987
987
schannel_cred .dwFlags |=
988
988
SCH_CRED_AUTO_CRED_VALIDATION | SCH_CRED_REVOCATION_CHECK_CHAIN ;
989
- TRACE ("enabled server certificate checks" , NULL );
989
+ TRACE ("%s" , " enabled server certificate checks" );
990
990
}
991
991
992
992
if (opt -> allow_invalid_hostname ) {
0 commit comments