diff options
Diffstat (limited to 'net/http/mock_sspi_library_win.cc')
-rw-r--r-- | net/http/mock_sspi_library_win.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/net/http/mock_sspi_library_win.cc b/net/http/mock_sspi_library_win.cc index de8f828..d0dae51 100644 --- a/net/http/mock_sspi_library_win.cc +++ b/net/http/mock_sspi_library_win.cc @@ -26,8 +26,9 @@ SECURITY_STATUS MockSSPILibrary::AcquireCredentialsHandle( void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) { - ADD_FAILURE(); - return ERROR_CALL_NOT_IMPLEMENTED; + // Fill in phCredential with arbitrary value. + phCredential->dwLower = phCredential->dwUpper = ((ULONG_PTR) ((INT_PTR)0)); + return SEC_E_OK; } SECURITY_STATUS MockSSPILibrary::InitializeSecurityContext( @@ -43,8 +44,13 @@ SECURITY_STATUS MockSSPILibrary::InitializeSecurityContext( PSecBufferDesc pOutput, unsigned long* contextAttr, PTimeStamp ptsExpiry) { - ADD_FAILURE(); - return ERROR_CALL_NOT_IMPLEMENTED; + // Fill in the outbound buffer with garbage data. + PSecBuffer out_buffer = pOutput->pBuffers; + out_buffer->cbBuffer = 2; + uint8* buf = reinterpret_cast<uint8 *>(out_buffer->pvBuffer); + buf[0] = 0xAB; + buf[1] = 0xBA; + return SEC_E_OK; } SECURITY_STATUS MockSSPILibrary::QuerySecurityPackageInfo( @@ -62,8 +68,10 @@ SECURITY_STATUS MockSSPILibrary::QuerySecurityPackageInfo( SECURITY_STATUS MockSSPILibrary::FreeCredentialsHandle( PCredHandle phCredential) { - ADD_FAILURE(); - return ERROR_CALL_NOT_IMPLEMENTED; + EXPECT_TRUE(phCredential->dwLower == ((ULONG_PTR) ((INT_PTR) 0))); + EXPECT_TRUE(phCredential->dwLower == ((ULONG_PTR) ((INT_PTR) 0))); + SecInvalidateHandle(phCredential); + return SEC_E_OK; } SECURITY_STATUS MockSSPILibrary::DeleteSecurityContext(PCtxtHandle phContext) { |