Commit 87368bb6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

secur32: Improve SECPKG_ATTR_CIPHER_STRENGTHS stub.

parent d11e30e4
...@@ -39,7 +39,7 @@ static SECURITY_STATUS schan_QueryCredentialsAttributes( ...@@ -39,7 +39,7 @@ static SECURITY_STATUS schan_QueryCredentialsAttributes(
if (pBuffer) if (pBuffer)
{ {
/* FIXME: get from CryptoAPI */ /* FIXME: get from CryptoAPI */
FIXME("%d: stub\n", ulAttribute); FIXME("SECPKG_ATTR_SUPPORTED_ALGS: stub\n");
ret = SEC_E_UNSUPPORTED_FUNCTION; ret = SEC_E_UNSUPPORTED_FUNCTION;
} }
else else
...@@ -48,9 +48,13 @@ static SECURITY_STATUS schan_QueryCredentialsAttributes( ...@@ -48,9 +48,13 @@ static SECURITY_STATUS schan_QueryCredentialsAttributes(
case SECPKG_ATTR_CIPHER_STRENGTHS: case SECPKG_ATTR_CIPHER_STRENGTHS:
if (pBuffer) if (pBuffer)
{ {
SecPkgCred_CipherStrengths *r = (SecPkgCred_CipherStrengths*)pBuffer;
/* FIXME: get from CryptoAPI */ /* FIXME: get from CryptoAPI */
FIXME("%d: stub\n", ulAttribute); FIXME("SECPKG_ATTR_CIPHER_STRENGTHS: semi-stub\n");
ret = SEC_E_UNSUPPORTED_FUNCTION; r->dwMinimumCipherStrength = 40;
r->dwMaximumCipherStrength = 168;
ret = SEC_E_OK;
} }
else else
ret = SEC_E_INTERNAL_ERROR; ret = SEC_E_INTERNAL_ERROR;
...@@ -59,7 +63,7 @@ static SECURITY_STATUS schan_QueryCredentialsAttributes( ...@@ -59,7 +63,7 @@ static SECURITY_STATUS schan_QueryCredentialsAttributes(
if (pBuffer) if (pBuffer)
{ {
/* FIXME: get from OpenSSL? */ /* FIXME: get from OpenSSL? */
FIXME("%d: stub\n", ulAttribute); FIXME("SECPKG_ATTR_SUPPORTED_PROTOCOLS: stub\n");
ret = SEC_E_UNSUPPORTED_FUNCTION; ret = SEC_E_UNSUPPORTED_FUNCTION;
} }
else else
......
...@@ -31,6 +31,7 @@ static HMODULE secdll, crypt32dll; ...@@ -31,6 +31,7 @@ static HMODULE secdll, crypt32dll;
static ACQUIRE_CREDENTIALS_HANDLE_FN_A pAcquireCredentialsHandleA; static ACQUIRE_CREDENTIALS_HANDLE_FN_A pAcquireCredentialsHandleA;
static FREE_CREDENTIALS_HANDLE_FN pFreeCredentialsHandle; static FREE_CREDENTIALS_HANDLE_FN pFreeCredentialsHandle;
static QUERY_CREDENTIALS_ATTRIBUTES_FN_A pQueryCredentialsAttributesA;
static PCCERT_CONTEXT (WINAPI *pCertCreateCertificateContext)(DWORD,const BYTE*,DWORD); static PCCERT_CONTEXT (WINAPI *pCertCreateCertificateContext)(DWORD,const BYTE*,DWORD);
static BOOL (WINAPI *pCertFreeCertificateContext)(PCCERT_CONTEXT); static BOOL (WINAPI *pCertFreeCertificateContext)(PCCERT_CONTEXT);
...@@ -120,6 +121,7 @@ static void InitFunctionPtrs(void) ...@@ -120,6 +121,7 @@ static void InitFunctionPtrs(void)
{ {
GET_PROC(secdll, AcquireCredentialsHandleA); GET_PROC(secdll, AcquireCredentialsHandleA);
GET_PROC(secdll, FreeCredentialsHandle); GET_PROC(secdll, FreeCredentialsHandle);
GET_PROC(secdll, QueryCredentialsAttributesA);
} }
GET_PROC(advapi32dll, CryptAcquireContextW); GET_PROC(advapi32dll, CryptAcquireContextW);
...@@ -134,6 +136,18 @@ static void InitFunctionPtrs(void) ...@@ -134,6 +136,18 @@ static void InitFunctionPtrs(void)
#undef GET_PROC #undef GET_PROC
} }
static void test_strength(PCredHandle handle)
{
SecPkgCred_CipherStrengths strength = {-1,-1};
SECURITY_STATUS st;
st = pQueryCredentialsAttributesA(handle, SECPKG_ATTR_CIPHER_STRENGTHS, &strength);
ok(st == SEC_E_OK, "QueryCredentialsAttributesA failed: %u\n", GetLastError());
ok(strength.dwMinimumCipherStrength, "dwMinimumCipherStrength not changed\n");
ok(strength.dwMaximumCipherStrength, "dwMaximumCipherStrength not changed\n");
trace("strength %d - %d\n", strength.dwMinimumCipherStrength, strength.dwMaximumCipherStrength);
}
static void testAcquireSecurityContext(void) static void testAcquireSecurityContext(void)
{ {
SECURITY_STATUS st; SECURITY_STATUS st;
...@@ -347,6 +361,7 @@ static void testAcquireSecurityContext(void) ...@@ -347,6 +361,7 @@ static void testAcquireSecurityContext(void)
st = pAcquireCredentialsHandleA(NULL, unisp_name_a, SECPKG_CRED_INBOUND, st = pAcquireCredentialsHandleA(NULL, unisp_name_a, SECPKG_CRED_INBOUND,
NULL, &schanCred, NULL, NULL, &cred, NULL); NULL, &schanCred, NULL, NULL, &cred, NULL);
ok(st == SEC_E_OK, "AcquireCredentialsHandleA failed: %08x\n", st); ok(st == SEC_E_OK, "AcquireCredentialsHandleA failed: %08x\n", st);
test_strength(&cred);
pFreeCredentialsHandle(&cred); pFreeCredentialsHandle(&cred);
/* How about more than one cert? */ /* How about more than one cert? */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment