From 62d806601bfa992f2e36ff4d208ea9781218bcd6 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 20 May 2010 17:23:25 -0700 Subject: [PATCH] rsaenh: Implement CALG_SSL3_SHAMD5 hashing. --- dlls/rsaenh/implglue.c | 1 + dlls/rsaenh/rsaenh.c | 3 ++- dlls/rsaenh/tests/rsaenh.c | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/rsaenh/implglue.c b/dlls/rsaenh/implglue.c index 7ecfc289ecf..c217007221c 100644 --- a/dlls/rsaenh/implglue.c +++ b/dlls/rsaenh/implglue.c @@ -342,6 +342,7 @@ BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContex case CALG_RSA_KEYX: case CALG_RSA_SIGN: + case CALG_SSL3_SHAMD5: outlen = inlen = (mp_count_bits(&pKeyContext->rsa.N)+7)/8; if (enc) { if (rsa_exptmod(in, inlen, out, &outlen, dwKeySpec, &pKeyContext->rsa) != CRYPT_OK) { diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index 8a5be9935c3..89bb7861660 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -1426,7 +1426,7 @@ static BOOL build_hash_signature(BYTE *pbSignature, DWORD dwLen, ALG_ID aiAlgid, ALG_ID aiAlgid; DWORD dwLen; CONST BYTE abOID[19]; - } aOIDDescriptor[8] = { + } aOIDDescriptor[] = { { CALG_MD2, 18, { 0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x02, 0x05, 0x00, 0x04, 0x10 } }, { CALG_MD4, 18, { 0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, @@ -1444,6 +1444,7 @@ static BOOL build_hash_signature(BYTE *pbSignature, DWORD dwLen, ALG_ID aiAlgid, { CALG_SHA_384, 19, { 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x40 } }, + { CALG_SSL3_SHAMD5, 0, { 0 } }, { 0, 0, { 0 } } }; DWORD dwIdxOID, i, j; diff --git a/dlls/rsaenh/tests/rsaenh.c b/dlls/rsaenh/tests/rsaenh.c index 1bab33f2489..5ee85f42a05 100644 --- a/dlls/rsaenh/tests/rsaenh.c +++ b/dlls/rsaenh/tests/rsaenh.c @@ -654,9 +654,7 @@ static void test_hashes(void) ok(result, "%08x\n", GetLastError()); ok(len == 128, "expected len 128, got %d\n", len); result = CryptSignHash(hHash, AT_KEYEXCHANGE, NULL, 0, pbSigValue, &len); - todo_wine ok(result, "%08x\n", GetLastError()); - todo_wine ok(!memcmp(pbSigValue, signed_ssl3_shamd5_hash, len), "unexpected value\n"); if (len != 128 || memcmp(pbSigValue, signed_ssl3_shamd5_hash, len)) { -- 2.11.4.GIT