From bf0406cf3a2f9450983e4b48537dfe9f12fdf707 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Tue, 27 Jan 2009 09:00:40 -0800 Subject: [PATCH] crypt32: Implement CertFindCertificateInStore for CERT_FIND_PUBLIC_KEY. --- dlls/crypt32/cert.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 3d2b3def9d6..5c2c786c97e 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -966,6 +966,17 @@ static BOOL compare_cert_by_name(PCCERT_CONTEXT pCertContext, DWORD dwType, return ret; } +static BOOL compare_cert_by_public_key(PCCERT_CONTEXT pCertContext, + DWORD dwType, DWORD dwFlags, const void *pvPara) +{ + CERT_PUBLIC_KEY_INFO *publicKey = (CERT_PUBLIC_KEY_INFO *)pvPara; + BOOL ret; + + ret = CertComparePublicKeyInfo(pCertContext->dwCertEncodingType, + &pCertContext->pCertInfo->SubjectPublicKeyInfo, publicKey); + return ret; +} + static BOOL compare_cert_by_subject_cert(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, const void *pvPara) { @@ -1201,6 +1212,9 @@ PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE hCertStore, case CERT_COMPARE_NAME: compare = compare_cert_by_name; break; + case CERT_COMPARE_PUBLIC_KEY: + compare = compare_cert_by_public_key; + break; case CERT_COMPARE_SUBJECT_CERT: compare = compare_cert_by_subject_cert; break;