647

SSPI Error

Caroce takaia problema pri vizove functzii InitializeSecurityContext programa zavershaiet svoiu rabotu s soobsheniem tipa nedopustimaia operatziia bla bla bla...... ,caroce bred kakoita vot kusok koda esli ktoto vidit oshibku ukojite plz :))) Zaranie blogodaren///////////////////////////////////////////////////////////////////////////////////////////////////void CCreateSock::GetRecvizit(){SECURITY_STATUS ss; SecPkgInfo *pkgInfo;PSecPkgInfo ppkgInfo;int i;ULONG pk_size;ss=EnumerateSecurityPackages(&pk_size,&pkgInfo); if(ss==SEC_E_OK){for(i=0;icbMaxToken;else{ReportSSPIError(ss);exit(0);}printf("Idiot popitka polucenia rekvizitov...\n");ss=AcquireCredentialsHandle(NULL,MICROSOFT_KERBEROS_NAME_A,SECPKG_CRED_BOTH,NULL,NULL,NULL,NULL,&hd,&ts);if(ss!=SEC_E_OK){printf("Ne udalosi poluciti recviziti(marker) danova protzesa\n");switch(ss){case SEC_E_NOT_OWNER:printf("Vi ne evliaetesi vlodelitzem danih recvezitov\n"); exit(0);break;case SEC_E_INVALID_HANDLE:printf("V functziu bil peredon nedostupnii opisateli\n");exit(0);break;case SEC_E_INVALID_TOKEN:printf("SEC_E_INVALID_TOKEN\n");exit(0);break;case SEC_E_NOT_SUPPORTED:printf("SEC_E_NOT_SUPPORTED:\n");exit(0);break;case SEC_E_QOP_NOT_SUPPORTED:printf("SEC_E_QOP_NOT_SUPPORTED:\n");exit(0);break;default:ReportSSPIError(ss);}}printf("Recviziti danova protzesa bili uspeshno poluceni\n");}///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void CCreateSock::OnInitContext(CredHandle *Phd,PULONG plAtributes){//PTimeStamp ptsExpiration;SECURITY_STATUS ss;SecBuffer secBufOut;SecBufferDesc secBufDescOut;SecBuffer secBufIn;SecBufferDesc secBufDescIn;CtxtHandle *hContext;BOOL pFirstPass=TRUE;ss=SEC_I_CONTINUE_NEEDED;printf("Sozdaiom kontecst polizivatelia...\n");try{pOut=(BYTE*) malloc(buf_size);while(ss==SEC_I_CONTINUE_NEEDED){PBYTE pbData;if(pFirstPass){secBufDescIn.cBuffers=0;secBufDescIn.pBuffers=NULL;secBufDescIn.ulVersion=SECBUFFER_VERSION;}else{ULONG lSize=0;rcv=recv(sock,(char*)lSize,sizeof(ULONG),0);if(rcv
0