| 19 | } |
| 20 | |
| 21 | int LocalNegotiator::handleType1(char* ntlmBytes, int len) |
| 22 | { |
| 23 | //printf("\n--handleType1 start --\n"); |
| 24 | TCHAR lpPackageName[1024] = L"Negotiate"; |
| 25 | TimeStamp ptsExpiry; |
| 26 | |
| 27 | int status = AcquireCredentialsHandle( |
| 28 | NULL, |
| 29 | lpPackageName, |
| 30 | SECPKG_CRED_INBOUND, |
| 31 | NULL, |
| 32 | NULL, |
| 33 | 0, |
| 34 | NULL, |
| 35 | &hCred, |
| 36 | &ptsExpiry); |
| 37 | |
| 38 | if (status != SEC_E_OK) |
| 39 | { |
| 40 | printf("Error in AquireCredentialsHandle"); |
| 41 | return -1; |
| 42 | } |
| 43 | |
| 44 | InitTokenContextBuffer(&secClientBufferDesc, &secClientBuffer); |
| 45 | InitTokenContextBuffer(&secServerBufferDesc, &secServerBuffer); |
| 46 | |
| 47 | phContext = new CtxtHandle(); |
| 48 | |
| 49 | secClientBuffer.cbBuffer = static_cast<unsigned long>(len); |
| 50 | secClientBuffer.pvBuffer = ntlmBytes; |
| 51 | |
| 52 | ULONG fContextAttr; |
| 53 | TimeStamp tsContextExpiry; |
| 54 | |
| 55 | status = AcceptSecurityContext( |
| 56 | &hCred, |
| 57 | nullptr, |
| 58 | &secClientBufferDesc, |
| 59 | ASC_REQ_ALLOCATE_MEMORY | ASC_REQ_CONNECTION, |
| 60 | //STANDARD_CONTEXT_ATTRIBUTES, |
| 61 | SECURITY_NATIVE_DREP, |
| 62 | phContext, |
| 63 | &secServerBufferDesc, |
| 64 | &fContextAttr, |
| 65 | &tsContextExpiry); |
| 66 | |
| 67 | //printf("\n-- Result of AcceptSecurityContext() = status: 0x%x--\n", status); |
| 68 | //printf("\n--handleType1 end --\n"); |
| 69 | return status; |
| 70 | } |
| 71 | |
| 72 | |
| 73 | int LocalNegotiator::handleType3(char* ntlmBytes, int len) |
no test coverage detected