Changeset 51a4ffb
- Timestamp:
- 2006-05-25T09:55:00Z (18 years ago)
- Branches:
- master
- Children:
- b1bd100
- Parents:
- 80c1e4d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/ssl_sspi.c
r80c1e4d r51a4ffb 65 65 SCHANNEL_CRED ssl_cred; 66 66 TimeStamp timestamp; 67 SecBuffer ibuf[2],obuf[1]; 68 SecBufferDesc ibufs,obufs; 69 ULONG req = ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT | 70 ISC_REQ_CONFIDENTIALITY | ISC_REQ_USE_SESSION_KEY | 71 ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_STREAM | ISC_REQ_EXTENDED_ERROR | 72 ISC_REQ_MANUAL_CRED_VALIDATION; 73 ULONG a; 67 74 68 75 conn->fd = proxy_connect( host, port, ssl_connected, conn ); … … 84 91 } 85 92 86 conn->context = NULL;87 88 93 memset(&ssl_cred, 0, sizeof(SCHANNEL_CRED)); 89 94 ssl_cred.dwVersion = SCHANNEL_CRED_VERSION; … … 91 96 92 97 SECURITY_STATUS st = AcquireCredentialsHandle(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &ssl_cred, NULL, NULL, &conn->cred, ×tamp); 93 94 InitializeSecurityContext(&conn->cred, &conn->context, host, FIXME, 1, FIXME); 95 96 QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes); 98 99 if (st != SEC_E_OK) 100 return NULL; 101 102 do { 103 /* initialize buffers */ 104 ibuf[0].cbBuffer = size; ibuf[0].pvBuffer = buf; 105 ibuf[1].cbBuffer = 0; ibuf[1].pvBuffer = NIL; 106 obuf[0].cbBuffer = 0; obuf[0].pvBuffer = NIL; 107 ibuf[0].BufferType = obuf[0].BufferType = SECBUFFER_TOKEN; 108 ibuf[1].BufferType = SECBUFFER_EMPTY; 109 110 /* initialize buffer descriptors */ 111 ibufs.ulVersion = obufs.ulVersion = SECBUFFER_VERSION; 112 ibufs.cBuffers = 2; obufs.cBuffers = 1; 113 ibufs.pBuffers = ibuf; obufs.pBuffers = obuf; 114 115 st = InitializeSecurityContext(&conn->cred, size?&conn->context:NULL, host, req, 0, SECURITY_NETWORK_DREP, size?&ibufs:NULL, 0, &conn->context, &obufs, &a, ×tamp); 116 if (obuf[0].pvBuffer && obuf[0].cbBuffer) { 117 send(conn->fd, obuf[0].pvBuffer, obuf[0].cbBuffer, 0); 118 } 119 120 switch (st) { 121 case SEC_I_INCOMPLETE_CREDENTIALS: 122 break; 123 case SEC_I_CONTINUE_NEEDED: 124 125 } 126 127 128 QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes); 97 129 98 130 … … 201 233 DeleteSecurityContext(&scd->context); 202 234 235 FreeCredentialHandle(&scd->cred); 236 203 237 closesocket( scd->fd ); 204 238 g_free(scd);
Note: See TracChangeset
for help on using the changeset viewer.