crypt32: implement CryptEnumOIDInfo and CryptFindOIDInfo.
- implement CryptEnumOIDInfo and CryptFindOIDInfo - implement CertOIDToAlgId and CertAlgIdToOID using CryptFindOIDInfo
This commit is contained in:
parent
110612c137
commit
690f98408b
|
@ -1,2 +1,3 @@
|
|||
Makefile
|
||||
crypt32.res
|
||||
libcrypt32.def
|
||||
|
|
|
@ -16,6 +16,8 @@ C_SRCS = \
|
|||
str.c \
|
||||
main.c
|
||||
|
||||
RC_SRCS = crypt32.rc
|
||||
|
||||
SUBDIRS = tests
|
||||
|
||||
@MAKE_DLL_RULES@
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* crypt32 dll resources
|
||||
*
|
||||
* Copyright (C) 2006 Juan Lang
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "cryptres.h"
|
||||
|
||||
#include "version.rc"
|
||||
|
||||
#include "crypt32_En.rc"
|
|
@ -0,0 +1,166 @@
|
|||
/*
|
||||
* crypt32 dll resources
|
||||
*
|
||||
* Copyright (C) 2006 Juan Lang
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_AUTHORITY_KEY_ID "Authority Key Identifier"
|
||||
IDS_KEY_ATTRIBUTES "Key Attributes"
|
||||
IDS_KEY_USAGE_RESTRICTION "Key Usage Restriction"
|
||||
IDS_SUBJECT_ALT_NAME "Subject Alternative Name"
|
||||
IDS_ISSUER_ALT_NAME "Issuer Alternative Name"
|
||||
IDS_BASIC_CONSTRAINTS "Basic Constraints"
|
||||
IDS_KEY_USAGE "Key Usage"
|
||||
IDS_CERT_POLICIES "Certificate Policies"
|
||||
IDS_SUBJECT_KEY_IDENTIFIER "Subject Key Identifier"
|
||||
IDS_CRL_REASON_CODE "CRL Reason Code"
|
||||
IDS_CRL_DIST_POINTS "CRL Distribution Points"
|
||||
IDS_ENHANCED_KEY_USAGE "Enhanced Key Usage"
|
||||
IDS_AUTHORITY_INFO_ACCESS "Authority Information Access"
|
||||
IDS_CERT_EXTENSIONS "Certificate Extensions"
|
||||
IDS_NEXT_UPDATE_LOCATION "Next Update Location"
|
||||
IDS_YES_OR_NO_TRUST "Yes or No Trust"
|
||||
IDS_EMAIL_ADDRESS "Email Address"
|
||||
IDS_UNSTRUCTURED_NAME "Unstructured Name"
|
||||
IDS_CONTENT_TYPE "Content Type"
|
||||
IDS_MESSAGE_DIGEST "Message Digest"
|
||||
IDS_SIGNING_TIME "Signing Time"
|
||||
IDS_COUNTER_SIGN "Counter Sign"
|
||||
IDS_CHALLENGE_PASSWORD "Challenge Password"
|
||||
IDS_UNSTRUCTURED_ADDRESS "Unstructured Address"
|
||||
IDS_SMIME_CAPABILITIES "SMIME Capabilities"
|
||||
IDS_PREFER_SIGNED_DATA "Prefer Signed Data"
|
||||
IDS_CPS "CPS"
|
||||
IDS_USER_NOTICE "User Notice"
|
||||
IDS_OCSP "On-line Certificate Status Protocol"
|
||||
IDS_CA_ISSUER "Certification Authority Issuer"
|
||||
IDS_CERT_TEMPLATE_NAME "Certification Template Name"
|
||||
IDS_CERT_TYPE "Certificate Type"
|
||||
IDS_CERT_MANIFOLD "Certificate Manifold"
|
||||
IDS_NETSCAPE_CERT_TYPE "Netscape Cert Type"
|
||||
IDS_NETSCAPE_BASE_URL "Netscape Base URL"
|
||||
IDS_NETSCAPE_REVOCATION_URL "Netscape Revocation URL"
|
||||
IDS_NETSCAPE_CA_REVOCATION_URL "Netscape CA Revocation URL"
|
||||
IDS_NETSCAPE_CERT_RENEWAL_URL "Netscape Cert Renewal URL"
|
||||
IDS_NETSCAPE_CA_POLICY_URL "Netscape CA Policy URL"
|
||||
IDS_NETSCAPE_SSL_SERVER_NAME "Netscape SSL ServerName"
|
||||
IDS_NETSCAPE_COMMENT "Netscape Comment"
|
||||
IDS_SPC_SP_AGENCY_INFO "SpcSpAgencyInfo"
|
||||
IDS_SPC_FINANCIAL_CRITERIA "SpcFinancialCriteria"
|
||||
IDS_SPC_MINIMAL_CRITERIA "SpcMinimalCriteria"
|
||||
IDS_COUNTRY "Country/Region"
|
||||
IDS_ORGANIZATION "Organization"
|
||||
IDS_ORGANIZATIONAL_UNIT "Organizational Unit"
|
||||
IDS_COMMON_NAME "Common Name"
|
||||
IDS_LOCALITY "Locality"
|
||||
IDS_STATE_OR_PROVINCE "State or Province"
|
||||
IDS_TITLE "Title"
|
||||
IDS_GIVEN_NAME "Given Name"
|
||||
IDS_INITIALS "Initials"
|
||||
IDS_SUR_NAME "Sur Name"
|
||||
IDS_DOMAIN_COMPONENT "Domain Component"
|
||||
IDS_STREET_ADDRESS "Street Address"
|
||||
IDS_SERIAL_NUMBER "Serial Number"
|
||||
IDS_CA_VERSION "CA Version"
|
||||
IDS_CROSS_CA_VERSION "Cross CA Version"
|
||||
IDS_SERIALIZED_SIG_SERIAL_NUMBER "Serialized Signature Serial Number"
|
||||
IDS_PRINCIPAL_NAME "Principal Name"
|
||||
IDS_WINDOWS_PRODUCT_UPDATE "Windows Product Update"
|
||||
IDS_ENROLLMENT_NAME_VALUE_PAIR "Enrollment Name Value Pair"
|
||||
IDS_OS_VERSION "OS Version"
|
||||
IDS_ENROLLMENT_CSP "Enrollment CSP"
|
||||
IDS_CRL_NUMBER "CRL Number"
|
||||
IDS_DELTA_CRL_INDICATOR "Delta CRL Indicator"
|
||||
IDS_ISSUING_DIST_POINT "Issuing Distribution Point"
|
||||
IDS_FRESHEST_CRL "Freshest CRL"
|
||||
IDS_NAME_CONSTRAINTS "Name Constraints"
|
||||
IDS_POLICY_MAPPINGS "Policy Mappings"
|
||||
IDS_POLICY_CONSTRAINTS "Policy Constraints"
|
||||
IDS_CROSS_CERT_DIST_POINTS "Cross-Certificate Distribution Points"
|
||||
IDS_APPLICATION_POLICIES "Application Policies"
|
||||
IDS_APPLICATION_POLICY_MAPPINGS "Application Policy Mappings"
|
||||
IDS_APPLICATION_POLICY_CONSTRAINTS "Application Policy Constraints"
|
||||
IDS_CMC_DATA "CMC Data"
|
||||
IDS_CMC_RESPONSE "CMC Response"
|
||||
IDS_UNSIGNED_CMC_REQUEST "Unsigned CMC Request"
|
||||
IDS_CMC_STATUS_INFO "CMC Status Info"
|
||||
IDS_CMC_EXTENSIONS "CMC Extensions"
|
||||
IDS_CMC_ATTRIBUTES "CMC Attributes"
|
||||
IDS_PKCS_7_DATA "PKCS 7 Data"
|
||||
IDS_PKCS_7_SIGNED "PKCS 7 Signed"
|
||||
IDS_PKCS_7_ENVELOPED "PKCS 7 Enveloped"
|
||||
IDS_PKCS_7_SIGNED_ENVELOPED "PKCS 7 Signed Enveloped"
|
||||
IDS_PKCS_7_DIGESTED "PKCS 7 Digested"
|
||||
IDS_PKCS_7_ENCRYPTED "PKCS 7 Encrypted"
|
||||
IDS_PREVIOUS_CA_CERT_HASH "Previous CA Certificate Hash"
|
||||
IDS_CRL_VIRTUAL_BASE "Virtual Base CRL Number"
|
||||
IDS_CRL_NEXT_PUBLISH "Next CRL Publish"
|
||||
IDS_CA_EXCHANGE "CA Encryption Certificate"
|
||||
IDS_KEY_RECOVERY_AGENT "Key Recovery Agent"
|
||||
IDS_CERTIFICATE_TEMPLATE "Certificate Template Information"
|
||||
IDS_ENTERPRISE_ROOT_OID "Enterprise Root OID"
|
||||
IDS_RDN_DUMMY_SIGNER "Dummy Signer"
|
||||
IDS_ARCHIVED_KEY_ATTR "Encrypted Private Key"
|
||||
IDS_CRL_SELF_CDP "Published CRL Locations"
|
||||
IDS_REQUIRE_CERT_CHAIN_POLICY "Enforce Certificate Chain Policy"
|
||||
IDS_TRANSACTION_ID "Transaction Id"
|
||||
IDS_SENDER_NONCE "Sender Nonce"
|
||||
IDS_RECIPIENT_NONCE "Recipient Nonce"
|
||||
IDS_REG_INFO "Reg Info"
|
||||
IDS_GET_CERTIFICATE "Get Certificate"
|
||||
IDS_GET_CRL "Get CRL"
|
||||
IDS_REVOKE_REQUEST "Revoke Request"
|
||||
IDS_QUERY_PENDING "Query Pending"
|
||||
IDS_SORTED_CTL "Certificate Trust List"
|
||||
IDS_ARCHIVED_KEY_CERT_HASH "Archived Key Certificate Hash"
|
||||
IDS_PRIVATE_KEY_USAGE_PERIOD "Private Key Usage Period"
|
||||
IDS_CLIENT_INFORMATION "Client Information"
|
||||
IDS_SERVER_AUTHENTICATION "Server Authentication"
|
||||
IDS_CLIENT_AUTHENTICATION "Client Authentication"
|
||||
IDS_CODE_SIGNING "Code Signing"
|
||||
IDS_SECURE_EMAIL "Secure Email"
|
||||
IDS_TIME_STAMPING "Time Stamping"
|
||||
IDS_MICROSOFT_TRUST_LIST_SIGNING "Microsoft Trust List Signing"
|
||||
IDS_MICROSOFT_TIME_STAMPING "Microsoft Time Stamping"
|
||||
IDS_IPSEC_END_SYSTEM "IP security end system"
|
||||
IDS_IPSEC_TUNNEL "IP security tunnel termination"
|
||||
IDS_IPSEC_USER "IP security user"
|
||||
IDS_EFS "Encrypting File System"
|
||||
IDS_WHQL_CRYPTO "Windows Hardware Driver Verification"
|
||||
IDS_NT5_CRYPTO "Windows System Component Verification"
|
||||
IDS_OEM_WHQL_CRYPTO "OEM Windows System Component Verification"
|
||||
IDS_EMBEDDED_NT_CRYPTO "Embedded Windows System Component Verification"
|
||||
IDS_KEY_PACK_LICENSES "Key Pack Licenses"
|
||||
IDS_LICENSE_SERVER "License Server Verification"
|
||||
IDS_SMART_CARD_LOGON "Smart Card Logon"
|
||||
IDS_DIGITAL_RIGHTS "Digital Rights"
|
||||
IDS_QUALIFIED_SUBORDINATION "Qualified Subordination"
|
||||
IDS_KEY_RECOVERY "Key Recovery"
|
||||
IDS_DOCUMENT_SIGNING "Document Signing"
|
||||
IDS_IPSEC_IKE_INTERMEDIATE "IP security IKE intermediate"
|
||||
IDS_FILE_RECOVERY "File Recovery"
|
||||
IDS_ROOT_LIST_SIGNER "Root List Signer"
|
||||
IDS_ANY_APPLICATION_POLICIES "All application policies"
|
||||
IDS_DS_EMAIL_REPLICATION "Directory Service Email Replication"
|
||||
IDS_ENROLLMENT_AGENT "Certificate Request Agent"
|
||||
IDS_LIFETIME_SIGNING "Lifetime Signing"
|
||||
IDS_ANY_CERT_POLICY "All issuance policies"
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
HCRYPTPROV CRYPT_GetDefaultProvider(void);
|
||||
|
||||
void CRYPT_InitFunctionSets(void);
|
||||
void CRYPT_FreeFunctionSets(void);
|
||||
void crypt_oid_init(HINSTANCE hinst);
|
||||
void crypt_oid_free(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
* Copyright 2006 Juan Lang
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __WINE_CRYPTRES_H__
|
||||
#define __WINE_CRYPTRES_H__
|
||||
|
||||
#define IDS_AUTHORITY_KEY_ID 1000
|
||||
#define IDS_KEY_ATTRIBUTES 1001
|
||||
#define IDS_KEY_USAGE_RESTRICTION 1002
|
||||
#define IDS_SUBJECT_ALT_NAME 1003
|
||||
#define IDS_ISSUER_ALT_NAME 1004
|
||||
#define IDS_BASIC_CONSTRAINTS 1005
|
||||
#define IDS_KEY_USAGE 1006
|
||||
#define IDS_CERT_POLICIES 1007
|
||||
#define IDS_SUBJECT_KEY_IDENTIFIER 1008
|
||||
#define IDS_CRL_REASON_CODE 1009
|
||||
#define IDS_CRL_DIST_POINTS 1010
|
||||
#define IDS_ENHANCED_KEY_USAGE 1011
|
||||
#define IDS_AUTHORITY_INFO_ACCESS 1012
|
||||
#define IDS_CERT_EXTENSIONS 1013
|
||||
#define IDS_NEXT_UPDATE_LOCATION 1014
|
||||
#define IDS_YES_OR_NO_TRUST 1015
|
||||
#define IDS_EMAIL_ADDRESS 1016
|
||||
#define IDS_UNSTRUCTURED_NAME 1017
|
||||
#define IDS_CONTENT_TYPE 1018
|
||||
#define IDS_MESSAGE_DIGEST 1019
|
||||
#define IDS_SIGNING_TIME 1020
|
||||
#define IDS_COUNTER_SIGN 1021
|
||||
#define IDS_CHALLENGE_PASSWORD 1022
|
||||
#define IDS_UNSTRUCTURED_ADDRESS 1023
|
||||
#define IDS_SMIME_CAPABILITIES 1024
|
||||
#define IDS_PREFER_SIGNED_DATA 1025
|
||||
#define IDS_CPS 1026
|
||||
#define IDS_USER_NOTICE 1027
|
||||
#define IDS_OCSP 1028
|
||||
#define IDS_CA_ISSUER 1029
|
||||
#define IDS_CERT_TEMPLATE_NAME 1030
|
||||
#define IDS_CERT_TYPE 1031
|
||||
#define IDS_CERT_MANIFOLD 1032
|
||||
#define IDS_NETSCAPE_CERT_TYPE 1033
|
||||
#define IDS_NETSCAPE_BASE_URL 1034
|
||||
#define IDS_NETSCAPE_REVOCATION_URL 1035
|
||||
#define IDS_NETSCAPE_CA_REVOCATION_URL 1036
|
||||
#define IDS_NETSCAPE_CERT_RENEWAL_URL 1037
|
||||
#define IDS_NETSCAPE_CA_POLICY_URL 1038
|
||||
#define IDS_NETSCAPE_SSL_SERVER_NAME 1039
|
||||
#define IDS_NETSCAPE_COMMENT 1040
|
||||
#define IDS_SPC_SP_AGENCY_INFO 1041
|
||||
#define IDS_SPC_FINANCIAL_CRITERIA 1042
|
||||
#define IDS_SPC_MINIMAL_CRITERIA 1043
|
||||
#define IDS_COUNTRY 1044
|
||||
#define IDS_ORGANIZATION 1045
|
||||
#define IDS_ORGANIZATIONAL_UNIT 1046
|
||||
#define IDS_COMMON_NAME 1047
|
||||
#define IDS_LOCALITY 1048
|
||||
#define IDS_STATE_OR_PROVINCE 1049
|
||||
#define IDS_TITLE 1050
|
||||
#define IDS_GIVEN_NAME 1051
|
||||
#define IDS_INITIALS 1052
|
||||
#define IDS_SUR_NAME 1053
|
||||
#define IDS_DOMAIN_COMPONENT 1054
|
||||
#define IDS_STREET_ADDRESS 1055
|
||||
#define IDS_SERIAL_NUMBER 1056
|
||||
#define IDS_CA_VERSION 1057
|
||||
#define IDS_CROSS_CA_VERSION 1058
|
||||
#define IDS_SERIALIZED_SIG_SERIAL_NUMBER 1059
|
||||
#define IDS_PRINCIPAL_NAME 1060
|
||||
#define IDS_WINDOWS_PRODUCT_UPDATE 1061
|
||||
#define IDS_ENROLLMENT_NAME_VALUE_PAIR 1062
|
||||
#define IDS_OS_VERSION 1063
|
||||
#define IDS_ENROLLMENT_CSP 1064
|
||||
#define IDS_CRL_NUMBER 1065
|
||||
#define IDS_DELTA_CRL_INDICATOR 1066
|
||||
#define IDS_ISSUING_DIST_POINT 1067
|
||||
#define IDS_FRESHEST_CRL 1068
|
||||
#define IDS_NAME_CONSTRAINTS 1069
|
||||
#define IDS_POLICY_MAPPINGS 1070
|
||||
#define IDS_POLICY_CONSTRAINTS 1071
|
||||
#define IDS_CROSS_CERT_DIST_POINTS 1072
|
||||
#define IDS_APPLICATION_POLICIES 1073
|
||||
#define IDS_APPLICATION_POLICY_MAPPINGS 1074
|
||||
#define IDS_APPLICATION_POLICY_CONSTRAINTS 1075
|
||||
#define IDS_CMC_DATA 1076
|
||||
#define IDS_CMC_RESPONSE 1077
|
||||
#define IDS_UNSIGNED_CMC_REQUEST 1078
|
||||
#define IDS_CMC_STATUS_INFO 1079
|
||||
#define IDS_CMC_EXTENSIONS 1080
|
||||
#define IDS_CMC_ATTRIBUTES 1081
|
||||
#define IDS_PKCS_7_DATA 1082
|
||||
#define IDS_PKCS_7_SIGNED 1083
|
||||
#define IDS_PKCS_7_ENVELOPED 1084
|
||||
#define IDS_PKCS_7_SIGNED_ENVELOPED 1085
|
||||
#define IDS_PKCS_7_DIGESTED 1086
|
||||
#define IDS_PKCS_7_ENCRYPTED 1087
|
||||
#define IDS_PREVIOUS_CA_CERT_HASH 1088
|
||||
#define IDS_CRL_VIRTUAL_BASE 1089
|
||||
#define IDS_CRL_NEXT_PUBLISH 1090
|
||||
#define IDS_CA_EXCHANGE 1091
|
||||
#define IDS_KEY_RECOVERY_AGENT 1092
|
||||
#define IDS_CERTIFICATE_TEMPLATE 1093
|
||||
#define IDS_ENTERPRISE_ROOT_OID 1094
|
||||
#define IDS_RDN_DUMMY_SIGNER 1095
|
||||
#define IDS_ARCHIVED_KEY_ATTR 1096
|
||||
#define IDS_CRL_SELF_CDP 1097
|
||||
#define IDS_REQUIRE_CERT_CHAIN_POLICY 1098
|
||||
#define IDS_TRANSACTION_ID 1099
|
||||
#define IDS_SENDER_NONCE 1100
|
||||
#define IDS_RECIPIENT_NONCE 1101
|
||||
#define IDS_REG_INFO 1102
|
||||
#define IDS_GET_CERTIFICATE 1103
|
||||
#define IDS_GET_CRL 1104
|
||||
#define IDS_REVOKE_REQUEST 1105
|
||||
#define IDS_QUERY_PENDING 1106
|
||||
#define IDS_SORTED_CTL 1107
|
||||
#define IDS_ARCHIVED_KEY_CERT_HASH 1108
|
||||
#define IDS_PRIVATE_KEY_USAGE_PERIOD 1109
|
||||
#define IDS_CLIENT_INFORMATION 1110
|
||||
#define IDS_SERVER_AUTHENTICATION 1111
|
||||
#define IDS_CLIENT_AUTHENTICATION 1112
|
||||
#define IDS_CODE_SIGNING 1113
|
||||
#define IDS_SECURE_EMAIL 1114
|
||||
#define IDS_TIME_STAMPING 1115
|
||||
#define IDS_MICROSOFT_TRUST_LIST_SIGNING 1116
|
||||
#define IDS_MICROSOFT_TIME_STAMPING 1117
|
||||
#define IDS_IPSEC_END_SYSTEM 1118
|
||||
#define IDS_IPSEC_TUNNEL 1119
|
||||
#define IDS_IPSEC_USER 1120
|
||||
#define IDS_EFS 1121
|
||||
#define IDS_WHQL_CRYPTO 1122
|
||||
#define IDS_NT5_CRYPTO 1123
|
||||
#define IDS_OEM_WHQL_CRYPTO 1124
|
||||
#define IDS_EMBEDDED_NT_CRYPTO 1125
|
||||
#define IDS_KEY_PACK_LICENSES 1126
|
||||
#define IDS_LICENSE_SERVER 1127
|
||||
#define IDS_SMART_CARD_LOGON 1128
|
||||
#define IDS_DIGITAL_RIGHTS 1129
|
||||
#define IDS_QUALIFIED_SUBORDINATION 1130
|
||||
#define IDS_KEY_RECOVERY 1131
|
||||
#define IDS_DOCUMENT_SIGNING 1132
|
||||
#define IDS_IPSEC_IKE_INTERMEDIATE 1133
|
||||
#define IDS_FILE_RECOVERY 1134
|
||||
#define IDS_ROOT_LIST_SIGNER 1135
|
||||
#define IDS_ANY_APPLICATION_POLICIES 1136
|
||||
#define IDS_DS_EMAIL_REPLICATION 1137
|
||||
#define IDS_ENROLLMENT_AGENT 1138
|
||||
#define IDS_LIFETIME_SIGNING 1139
|
||||
#define IDS_ANY_CERT_POLICY 1140
|
||||
|
||||
#endif /* ndef __WINE_CRYPTRES_H__ */
|
|
@ -40,10 +40,10 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved)
|
|||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hInstance);
|
||||
CRYPT_InitFunctionSets();
|
||||
crypt_oid_init(hInstance);
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
CRYPT_FreeFunctionSets();
|
||||
crypt_oid_free();
|
||||
if (hDefProv) CryptReleaseContext(hDefProv, 0);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright 2002 Mike McCormack for CodeWeavers
|
||||
* Copyright 2005 Juan Lang
|
||||
* Copyright 2005-2006 Juan Lang
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -22,13 +22,33 @@
|
|||
#include "winbase.h"
|
||||
#include "wincrypt.h"
|
||||
#include "winreg.h"
|
||||
#include "winuser.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wine/list.h"
|
||||
#include "crypt32_private.h"
|
||||
#include "cryptres.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(crypt);
|
||||
|
||||
static const WCHAR DllW[] = { 'D','l','l',0 };
|
||||
|
||||
static void init_function_sets(void);
|
||||
static void init_oid_info(HINSTANCE hinst);
|
||||
static void free_function_sets(void);
|
||||
static void free_oid_info(void);
|
||||
|
||||
void crypt_oid_init(HINSTANCE hinst)
|
||||
{
|
||||
init_function_sets();
|
||||
init_oid_info(hinst);
|
||||
}
|
||||
|
||||
void crypt_oid_free(void)
|
||||
{
|
||||
free_function_sets();
|
||||
free_oid_info();
|
||||
}
|
||||
|
||||
CRITICAL_SECTION funcSetCS;
|
||||
struct list funcSets;
|
||||
|
||||
|
@ -47,13 +67,13 @@ struct OIDFunction
|
|||
struct list next;
|
||||
};
|
||||
|
||||
void CRYPT_InitFunctionSets(void)
|
||||
static void init_function_sets(void)
|
||||
{
|
||||
InitializeCriticalSection(&funcSetCS);
|
||||
list_init(&funcSets);
|
||||
}
|
||||
|
||||
void CRYPT_FreeFunctionSets(void)
|
||||
static void free_function_sets(void)
|
||||
{
|
||||
struct OIDFunctionSet *setCursor, *setNext;
|
||||
|
||||
|
@ -76,21 +96,6 @@ void CRYPT_FreeFunctionSets(void)
|
|||
DeleteCriticalSection(&funcSetCS);
|
||||
}
|
||||
|
||||
BOOL WINAPI CryptEnumOIDInfo(DWORD dwGroupId, DWORD dwFlags, void *pvArg,
|
||||
PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo)
|
||||
{
|
||||
FIXME("(%ld, %08lx, %p, %p): stub\n", dwGroupId, dwFlags, pvArg,
|
||||
pfnEnumOIDInfo);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey,
|
||||
DWORD dwGroupId)
|
||||
{
|
||||
FIXME("(%ld, %p, %ld): stub\n", dwKeyType, pvKey, dwGroupId);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* There is no free function associated with this; therefore, the sets are
|
||||
* freed when crypt32.dll is unloaded.
|
||||
*/
|
||||
|
@ -572,92 +577,554 @@ BOOL WINAPI CryptSetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName,
|
|||
return rc ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
struct OIDToAlgID
|
||||
{
|
||||
LPCSTR oid;
|
||||
DWORD algID;
|
||||
CRITICAL_SECTION oidInfoCS;
|
||||
struct list oidInfo;
|
||||
|
||||
static const WCHAR tripledes[] = { '3','d','e','s',0 };
|
||||
static const WCHAR cms3deswrap[] = { 'C','M','S','3','D','E','S','w','r','a',
|
||||
'p',0 };
|
||||
static const WCHAR cmsrc2wrap[] = { 'C','M','S','R','C','2','w','r','a','p',0 };
|
||||
static const WCHAR des[] = { 'd','e','s',0 };
|
||||
static const WCHAR md2[] = { 'm','d','2',0 };
|
||||
static const WCHAR md4[] = { 'm','d','4',0 };
|
||||
static const WCHAR md5[] = { 'm','d','5',0 };
|
||||
static const WCHAR rc2[] = { 'r','c','2',0 };
|
||||
static const WCHAR rc4[] = { 'r','c','4',0 };
|
||||
static const WCHAR sha[] = { 's','h','a',0 };
|
||||
static const WCHAR sha1[] = { 's','h','a','1',0 };
|
||||
static const WCHAR RSA[] = { 'R','S','A',0 };
|
||||
static const WCHAR RSA_KEYX[] = { 'R','S','A','_','K','E','Y','X',0 };
|
||||
static const WCHAR RSA_SIGN[] = { 'R','S','A','_','S','I','G','N',0 };
|
||||
static const WCHAR DSA[] = { 'D','S','A',0 };
|
||||
static const WCHAR DSA_SIGN[] = { 'D','S','A','_','S','I','G','N',0 };
|
||||
static const WCHAR DH[] = { 'D','H',0 };
|
||||
static const WCHAR DSS[] = { 'D','S','S',0 };
|
||||
static const WCHAR mosaicKMandUpdSig[] =
|
||||
{ 'm','o','s','a','i','c','K','M','a','n','d','U','p','d','S','i','g',0 };
|
||||
static const WCHAR ESDH[] = { 'E','S','D','H',0 };
|
||||
static const WCHAR NO_SIGN[] = { 'N','O','S','I','G','N',0 };
|
||||
static const WCHAR dsaSHA1[] = { 'd','s','a','S','H','A','1',0 };
|
||||
static const WCHAR md2RSA[] = { 'm','d','2','R','S','A',0 };
|
||||
static const WCHAR md4RSA[] = { 'm','d','4','R','S','A',0 };
|
||||
static const WCHAR md5RSA[] = { 'm','d','5','R','S','A',0 };
|
||||
static const WCHAR shaDSA[] = { 's','h','a','D','S','A',0 };
|
||||
static const WCHAR sha1DSA[] = { 's','h','a','1','D','S','A',0 };
|
||||
static const WCHAR shaRSA[] = { 's','h','a','R','S','A',0 };
|
||||
static const WCHAR sha1RSA[] = { 's','h','a','1','R','S','A',0 };
|
||||
static const WCHAR mosaicUpdatedSig[] =
|
||||
{ 'm','o','s','a','i','c','U','p','d','a','t','e','d','S','i','g',0 };
|
||||
static const WCHAR CN[] = { 'C','N',0 };
|
||||
static const WCHAR L[] = { 'L',0 };
|
||||
static const WCHAR O[] = { 'O',0 };
|
||||
static const WCHAR OU[] = { 'O','U',0 };
|
||||
static const WCHAR E[] = { 'E',0 };
|
||||
static const WCHAR C[] = { 'C',0 };
|
||||
static const WCHAR S[] = { 'S',0 };
|
||||
static const WCHAR ST[] = { 'S','T',0 };
|
||||
static const WCHAR STREET[] = { 'S','T','R','E','E','T',0 };
|
||||
static const WCHAR T[] = { 'T',0 };
|
||||
static const WCHAR Title[] = { 'T','i','t','l','e',0 };
|
||||
static const WCHAR G[] = { 'G',0 };
|
||||
static const WCHAR GivenName[] = { 'G','i','v','e','n','N','a','m','e',0 };
|
||||
static const WCHAR I[] = { 'I',0 };
|
||||
static const WCHAR Initials[] = { 'I','n','i','t','i','a','l','s',0 };
|
||||
static const WCHAR SN[] = { 'S','N',0 };
|
||||
static const WCHAR DC[] = { 'D','C',0 };
|
||||
static const WCHAR Description[] =
|
||||
{ 'D','e','s','c','r','i','p','t','i','o','n',0 };
|
||||
static const WCHAR PostalCode[] = { 'P','o','s','t','a','l','C','o','d','e',0 };
|
||||
static const WCHAR POBox[] = { 'P','O','B','o','x',0 };
|
||||
static const WCHAR Phone[] = { 'P','h','o','n','e',0 };
|
||||
static const WCHAR X21Address[] = { 'X','2','1','A','d','d','r','e','s','s',0 };
|
||||
static const WCHAR dnQualifier[] =
|
||||
{ 'd','n','Q','u','a','l','i','f','i','e','r',0 };
|
||||
static const WCHAR Email[] = { 'E','m','a','i','l',0 };
|
||||
static const WCHAR GN[] = { 'G','N',0 };
|
||||
|
||||
static const DWORD noNullFlag = CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG;
|
||||
static const DWORD mosaicFlags = CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG |
|
||||
CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG;
|
||||
static const CRYPT_DATA_BLOB noNullBlob = { sizeof(noNullFlag),
|
||||
(LPBYTE)&noNullFlag };
|
||||
static const CRYPT_DATA_BLOB mosaicFlagsBlob = { sizeof(mosaicFlags),
|
||||
(LPBYTE)&mosaicFlags };
|
||||
|
||||
static const DWORD rsaSign = CALG_RSA_SIGN;
|
||||
static const DWORD dssSign[2] = { CALG_DSS_SIGN,
|
||||
CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG };
|
||||
static const DWORD mosaicSign[2] = { CALG_DSS_SIGN,
|
||||
CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG |
|
||||
CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG };
|
||||
static const CRYPT_DATA_BLOB rsaSignBlob = { sizeof(rsaSign),
|
||||
(LPBYTE)&rsaSign };
|
||||
static const CRYPT_DATA_BLOB dssSignBlob = { sizeof(dssSign),
|
||||
(LPBYTE)dssSign };
|
||||
static const CRYPT_DATA_BLOB mosaicSignBlob = { sizeof(mosaicSign),
|
||||
(LPBYTE)mosaicSign };
|
||||
|
||||
static const DWORD ia5String[] = { CERT_RDN_IA5_STRING, 0 };
|
||||
static const DWORD numericString[] = { CERT_RDN_NUMERIC_STRING, 0 };
|
||||
static const DWORD printableString[] = { CERT_RDN_PRINTABLE_STRING, 0 };
|
||||
static const DWORD domainCompTypes[] = { CERT_RDN_IA5_STRING,
|
||||
CERT_RDN_UTF8_STRING, 0 };
|
||||
static const CRYPT_DATA_BLOB ia5StringBlob = { sizeof(ia5String),
|
||||
(LPBYTE)ia5String };
|
||||
static const CRYPT_DATA_BLOB numericStringBlob = { sizeof(numericString),
|
||||
(LPBYTE)numericString };
|
||||
static const CRYPT_DATA_BLOB printableStringBlob = { sizeof(printableString),
|
||||
(LPBYTE)printableString };
|
||||
static const CRYPT_DATA_BLOB domainCompTypesBlob = { sizeof(domainCompTypes),
|
||||
(LPBYTE)domainCompTypes };
|
||||
|
||||
struct OIDInfoConstructor {
|
||||
DWORD dwGroupId;
|
||||
LPCSTR pszOID;
|
||||
UINT Algid;
|
||||
LPCWSTR pwszName;
|
||||
const CRYPT_DATA_BLOB *blob;
|
||||
} oidInfoConstructors[] = {
|
||||
{ 1, szOID_OIWSEC_sha1, CALG_SHA1, sha1, NULL },
|
||||
{ 1, szOID_OIWSEC_sha1, CALG_SHA1, sha, NULL },
|
||||
{ 1, szOID_OIWSEC_sha, CALG_SHA, sha, NULL },
|
||||
{ 1, szOID_RSA_MD5, CALG_MD5, md5, NULL },
|
||||
{ 1, szOID_RSA_MD4, CALG_MD4, md4, NULL },
|
||||
{ 1, szOID_RSA_MD2, CALG_MD2, md2, NULL },
|
||||
|
||||
{ 2, szOID_OIWSEC_desCBC, CALG_DES, des, NULL },
|
||||
{ 2, szOID_RSA_DES_EDE3_CBC, CALG_3DES, tripledes, NULL },
|
||||
{ 2, szOID_RSA_RC2CBC, CALG_RC2, rc2, NULL },
|
||||
{ 2, szOID_RSA_RC4, CALG_RC4, rc4, NULL },
|
||||
{ 2, szOID_RSA_SMIMEalgCMS3DESwrap, CALG_3DES, cms3deswrap, NULL },
|
||||
{ 2, szOID_RSA_SMIMEalgCMSRC2wrap, CALG_RC2, cmsrc2wrap, NULL },
|
||||
|
||||
{ 3, szOID_RSA_RSA, CALG_RSA_KEYX, RSA, NULL },
|
||||
{ 3, szOID_X957_DSA, CALG_DSS_SIGN, DSA, &noNullBlob },
|
||||
{ 3, szOID_ANSI_X942_DH, CALG_DH_SF, DH, &noNullBlob },
|
||||
{ 3, szOID_RSA_RSA, CALG_RSA_KEYX, RSA_KEYX, NULL },
|
||||
{ 3, szOID_RSA_RSA, CALG_RSA_SIGN, RSA, NULL },
|
||||
{ 3, szOID_RSA_RSA, CALG_RSA_SIGN, RSA_SIGN, NULL },
|
||||
{ 3, szOID_OIWSEC_dsa, CALG_DSS_SIGN, DSA, &noNullBlob },
|
||||
{ 3, szOID_OIWSEC_dsa, CALG_DSS_SIGN, DSS, &noNullBlob },
|
||||
{ 3, szOID_OIWSEC_dsa, CALG_DSS_SIGN, DSA_SIGN, &noNullBlob },
|
||||
{ 3, szOID_RSA_DH, CALG_DH_SF, DH, &noNullBlob },
|
||||
{ 3, szOID_OIWSEC_rsaXchg, CALG_RSA_KEYX, RSA_KEYX, NULL },
|
||||
{ 3, szOID_INFOSEC_mosaicKMandUpdSig, CALG_DSS_SIGN, mosaicKMandUpdSig,
|
||||
&mosaicFlagsBlob },
|
||||
{ 3, szOID_RSA_SMIMEalgESDH, CALG_DH_EPHEM, ESDH, &noNullBlob },
|
||||
{ 3, szOID_PKIX_NO_SIGNATURE, CALG_NO_SIGN, NO_SIGN, NULL },
|
||||
|
||||
{ 4, szOID_RSA_SHA1RSA, CALG_SHA1, sha1RSA, &rsaSignBlob },
|
||||
{ 4, szOID_RSA_MD5RSA, CALG_MD5, md5RSA, &rsaSignBlob },
|
||||
{ 4, szOID_X957_SHA1DSA, CALG_SHA1, sha1DSA, &dssSignBlob },
|
||||
{ 4, szOID_OIWSEC_sha1RSASign, CALG_SHA1, sha1RSA, &rsaSignBlob },
|
||||
{ 4, szOID_OIWSEC_sha1RSASign, CALG_SHA1, shaRSA, &rsaSignBlob },
|
||||
{ 4, szOID_OIWSEC_shaRSA, CALG_SHA1, shaRSA, &rsaSignBlob },
|
||||
{ 4, szOID_OIWSEC_md5RSA, CALG_MD5, md5RSA, &rsaSignBlob },
|
||||
{ 4, szOID_RSA_MD2RSA, CALG_MD2, md2RSA, &rsaSignBlob },
|
||||
{ 4, szOID_RSA_MD4RSA, CALG_MD4, md4RSA, &rsaSignBlob },
|
||||
{ 4, szOID_OIWSEC_md4RSA, CALG_MD4, md4RSA, &rsaSignBlob },
|
||||
{ 4, szOID_OIWSEC_md4RSA2, CALG_MD4, md4RSA, &rsaSignBlob },
|
||||
{ 4, szOID_OIWDIR_md2RSA, CALG_MD2, md2RSA, &rsaSignBlob },
|
||||
{ 4, szOID_OIWSEC_shaDSA, CALG_SHA1, sha1DSA, &dssSignBlob },
|
||||
{ 4, szOID_OIWSEC_shaDSA, CALG_SHA1, shaDSA, &dssSignBlob },
|
||||
{ 4, szOID_OIWSEC_dsaSHA1, CALG_SHA1, dsaSHA1, &dssSignBlob },
|
||||
{ 4, szOID_INFOSEC_mosaicUpdatedSig, CALG_SHA1, mosaicUpdatedSig,
|
||||
&mosaicSignBlob },
|
||||
|
||||
{ 5, szOID_COMMON_NAME, 0, CN, NULL },
|
||||
{ 5, szOID_LOCALITY_NAME, 0, L, NULL },
|
||||
{ 5, szOID_ORGANIZATION_NAME, 0, O, NULL },
|
||||
{ 5, szOID_ORGANIZATIONAL_UNIT_NAME, 0, OU, NULL },
|
||||
{ 5, szOID_RSA_emailAddr, 0, E, &ia5StringBlob },
|
||||
{ 5, szOID_RSA_emailAddr, 0, Email, &ia5StringBlob },
|
||||
{ 5, szOID_COUNTRY_NAME, 0, C, &printableStringBlob },
|
||||
{ 5, szOID_STATE_OR_PROVINCE_NAME, 0, S, NULL },
|
||||
{ 5, szOID_STATE_OR_PROVINCE_NAME, 0, ST, NULL },
|
||||
{ 5, szOID_STREET_ADDRESS, 0, STREET, NULL },
|
||||
{ 5, szOID_TITLE, 0, T, NULL },
|
||||
{ 5, szOID_TITLE, 0, Title, NULL },
|
||||
{ 5, szOID_GIVEN_NAME, 0, G, NULL },
|
||||
{ 5, szOID_GIVEN_NAME, 0, GN, NULL },
|
||||
{ 5, szOID_GIVEN_NAME, 0, GivenName, NULL },
|
||||
{ 5, szOID_INITIALS, 0, I, NULL },
|
||||
{ 5, szOID_INITIALS, 0, Initials, NULL },
|
||||
{ 5, szOID_SUR_NAME, 0, SN, NULL },
|
||||
{ 5, szOID_DOMAIN_COMPONENT, 0, DC, &domainCompTypesBlob },
|
||||
{ 5, szOID_DESCRIPTION, 0, Description, NULL },
|
||||
{ 5, szOID_POSTAL_CODE, 0, PostalCode, NULL },
|
||||
{ 5, szOID_POST_OFFICE_BOX, 0, POBox, NULL },
|
||||
{ 5, szOID_TELEPHONE_NUMBER, 0, Phone, &printableStringBlob },
|
||||
{ 5, szOID_X21_ADDRESS, 0, X21Address, &numericStringBlob },
|
||||
{ 5, szOID_DN_QUALIFIER, 0, dnQualifier, NULL },
|
||||
|
||||
{ 6, szOID_AUTHORITY_KEY_IDENTIFIER2, 0, (LPCWSTR)IDS_AUTHORITY_KEY_ID, NULL },
|
||||
{ 6, szOID_AUTHORITY_KEY_IDENTIFIER, 0, (LPCWSTR)IDS_AUTHORITY_KEY_ID, NULL },
|
||||
{ 6, szOID_KEY_ATTRIBUTES, 0, (LPCWSTR)IDS_KEY_ATTRIBUTES, NULL },
|
||||
{ 6, szOID_KEY_USAGE_RESTRICTION, 0, (LPCWSTR)IDS_KEY_USAGE_RESTRICTION, NULL },
|
||||
{ 6, szOID_SUBJECT_ALT_NAME2, 0, (LPCWSTR)IDS_SUBJECT_ALT_NAME, NULL },
|
||||
{ 6, szOID_SUBJECT_ALT_NAME, 0, (LPCWSTR)IDS_SUBJECT_ALT_NAME, NULL },
|
||||
{ 6, szOID_ISSUER_ALT_NAME2, 0, (LPCWSTR)IDS_ISSUER_ALT_NAME, NULL },
|
||||
{ 6, szOID_ISSUER_ALT_NAME2, 0, (LPCWSTR)IDS_ISSUER_ALT_NAME, NULL },
|
||||
{ 6, szOID_BASIC_CONSTRAINTS2, 0, (LPCWSTR)IDS_BASIC_CONSTRAINTS, NULL },
|
||||
{ 6, szOID_BASIC_CONSTRAINTS, 0, (LPCWSTR)IDS_BASIC_CONSTRAINTS, NULL },
|
||||
{ 6, szOID_KEY_USAGE, 0, (LPCWSTR)IDS_KEY_USAGE, NULL },
|
||||
{ 6, szOID_CERT_POLICIES, 0, (LPCWSTR)IDS_CERT_POLICIES, NULL },
|
||||
{ 6, szOID_SUBJECT_KEY_IDENTIFIER, 0, (LPCWSTR)IDS_SUBJECT_KEY_IDENTIFIER, NULL },
|
||||
{ 6, szOID_CRL_REASON_CODE, 0, (LPCWSTR)IDS_CRL_REASON_CODE, NULL },
|
||||
{ 6, szOID_CRL_DIST_POINTS, 0, (LPCWSTR)IDS_CRL_DIST_POINTS, NULL },
|
||||
{ 6, szOID_ENHANCED_KEY_USAGE, 0, (LPCWSTR)IDS_ENHANCED_KEY_USAGE, NULL },
|
||||
{ 6, szOID_AUTHORITY_INFO_ACCESS, 0, (LPCWSTR)IDS_AUTHORITY_INFO_ACCESS, NULL },
|
||||
{ 6, szOID_CERT_EXTENSIONS, 0, (LPCWSTR)IDS_CERT_EXTENSIONS, NULL },
|
||||
{ 6, szOID_RSA_certExtensions, 0, (LPCWSTR)IDS_CERT_EXTENSIONS, NULL },
|
||||
{ 6, szOID_NEXT_UPDATE_LOCATION, 0, (LPCWSTR)IDS_NEXT_UPDATE_LOCATION, NULL },
|
||||
{ 6, szOID_YESNO_TRUST_ATTR, 0, (LPCWSTR)IDS_YES_OR_NO_TRUST, NULL },
|
||||
{ 6, szOID_RSA_emailAddr, 0, (LPCWSTR)IDS_EMAIL_ADDRESS, NULL },
|
||||
{ 6, szOID_RSA_unstructName, 0, (LPCWSTR)IDS_UNSTRUCTURED_NAME, NULL },
|
||||
{ 6, szOID_RSA_contentType, 0, (LPCWSTR)IDS_CONTENT_TYPE, NULL },
|
||||
{ 6, szOID_RSA_messageDigest, 0, (LPCWSTR)IDS_MESSAGE_DIGEST, NULL },
|
||||
{ 6, szOID_RSA_signingTime, 0, (LPCWSTR)IDS_SIGNING_TIME, NULL },
|
||||
{ 6, szOID_RSA_counterSign, 0, (LPCWSTR)IDS_COUNTER_SIGN, NULL },
|
||||
{ 6, szOID_RSA_challengePwd, 0, (LPCWSTR)IDS_CHALLENGE_PASSWORD, NULL },
|
||||
{ 6, szOID_RSA_unstructAddr, 0, (LPCWSTR)IDS_UNSTRUCTURED_ADDRESS, NULL },
|
||||
{ 6, szOID_RSA_SMIMECapabilities, 0, (LPCWSTR)IDS_SMIME_CAPABILITIES, NULL },
|
||||
{ 6, szOID_RSA_preferSignedData, 0, (LPCWSTR)IDS_PREFER_SIGNED_DATA, NULL },
|
||||
{ 6, szOID_PKIX_POLICY_QUALIFIER_CPS, 0, (LPCWSTR)IDS_CPS, NULL },
|
||||
{ 6, szOID_PKIX_POLICY_QUALIFIER_USERNOTICE, 0, (LPCWSTR)IDS_USER_NOTICE, NULL },
|
||||
{ 6, szOID_PKIX_OCSP, 0, (LPCWSTR)IDS_OCSP, NULL },
|
||||
{ 6, szOID_PKIX_CA_ISSUERS, 0, (LPCWSTR)IDS_CA_ISSUER, NULL },
|
||||
{ 6, szOID_ENROLL_CERTTYPE_EXTENSION, 0, (LPCWSTR)IDS_CERT_TEMPLATE_NAME, NULL },
|
||||
{ 6, szOID_ENROLL_CERTTYPE_EXTENSION, 0, (LPCWSTR)IDS_CERT_TYPE, NULL },
|
||||
{ 6, szOID_CERT_MANIFOLD, 0, (LPCWSTR)IDS_CERT_MANIFOLD, NULL },
|
||||
{ 6, szOID_NETSCAPE_CERT_TYPE, 0, (LPCWSTR)IDS_NETSCAPE_CERT_TYPE, NULL },
|
||||
{ 6, szOID_NETSCAPE_BASE_URL, 0, (LPCWSTR)IDS_NETSCAPE_BASE_URL, NULL },
|
||||
{ 6, szOID_NETSCAPE_REVOCATION_URL, 0, (LPCWSTR)IDS_NETSCAPE_REVOCATION_URL, NULL },
|
||||
{ 6, szOID_NETSCAPE_CA_REVOCATION_URL, 0, (LPCWSTR)IDS_NETSCAPE_CA_REVOCATION_URL, NULL },
|
||||
{ 6, szOID_NETSCAPE_CERT_RENEWAL_URL, 0, (LPCWSTR)IDS_NETSCAPE_CERT_RENEWAL_URL, NULL },
|
||||
{ 6, szOID_NETSCAPE_CA_POLICY_URL, 0, (LPCWSTR)IDS_NETSCAPE_CA_POLICY_URL, NULL },
|
||||
{ 6, szOID_NETSCAPE_SSL_SERVER_NAME, 0, (LPCWSTR)IDS_NETSCAPE_SSL_SERVER_NAME, NULL },
|
||||
{ 6, szOID_NETSCAPE_COMMENT, 0, (LPCWSTR)IDS_NETSCAPE_COMMENT, NULL },
|
||||
{ 6, "1.3.6.1.4.1.311.2.1.10", 0, (LPCWSTR)IDS_SPC_SP_AGENCY_INFO, NULL },
|
||||
{ 6, "1.3.6.1.4.1.311.2.1.27", 0, (LPCWSTR)IDS_SPC_FINANCIAL_CRITERIA, NULL },
|
||||
{ 6, "1.3.6.1.4.1.311.2.1.26", 0, (LPCWSTR)IDS_SPC_MINIMAL_CRITERIA, NULL },
|
||||
{ 6, szOID_COUNTRY_NAME, 0, (LPCWSTR)IDS_COUNTRY, NULL },
|
||||
{ 6, szOID_ORGANIZATION_NAME, 0, (LPCWSTR)IDS_ORGANIZATION, NULL },
|
||||
{ 6, szOID_ORGANIZATIONAL_UNIT_NAME, 0, (LPCWSTR)IDS_ORGANIZATIONAL_UNIT, NULL },
|
||||
{ 6, szOID_COMMON_NAME, 0, (LPCWSTR)IDS_COMMON_NAME, NULL },
|
||||
{ 6, szOID_LOCALITY_NAME, 0, (LPCWSTR)IDS_LOCALITY, NULL },
|
||||
{ 6, szOID_STATE_OR_PROVINCE_NAME, 0, (LPCWSTR)IDS_STATE_OR_PROVINCE, NULL },
|
||||
{ 6, szOID_TITLE, 0, (LPCWSTR)IDS_TITLE, NULL },
|
||||
{ 6, szOID_GIVEN_NAME, 0, (LPCWSTR)IDS_GIVEN_NAME, NULL },
|
||||
{ 6, szOID_INITIALS, 0, (LPCWSTR)IDS_INITIALS, NULL },
|
||||
{ 6, szOID_SUR_NAME, 0, (LPCWSTR)IDS_SUR_NAME, NULL },
|
||||
{ 6, szOID_DOMAIN_COMPONENT, 0, (LPCWSTR)IDS_DOMAIN_COMPONENT, NULL },
|
||||
{ 6, szOID_STREET_ADDRESS, 0, (LPCWSTR)IDS_STREET_ADDRESS, NULL },
|
||||
{ 6, szOID_DEVICE_SERIAL_NUMBER, 0, (LPCWSTR)IDS_SERIAL_NUMBER, NULL },
|
||||
{ 6, szOID_CERTSRV_CA_VERSION, 0, (LPCWSTR)IDS_CA_VERSION, NULL },
|
||||
{ 6, szOID_CERTSRV_CROSSCA_VERSION, 0, (LPCWSTR)IDS_CROSS_CA_VERSION, NULL },
|
||||
{ 6, szOID_SERIALIZED, 0, (LPCWSTR)IDS_SERIALIZED_SIG_SERIAL_NUMBER, NULL },
|
||||
{ 6, szOID_NT_PRINCIPAL_NAME, 0, (LPCWSTR)IDS_PRINCIPAL_NAME, NULL },
|
||||
{ 6, szOID_PRODUCT_UPDATE, 0, (LPCWSTR)IDS_WINDOWS_PRODUCT_UPDATE, NULL },
|
||||
{ 6, szOID_ENROLLMENT_NAME_VALUE_PAIR, 0, (LPCWSTR)IDS_ENROLLMENT_NAME_VALUE_PAIR, NULL },
|
||||
{ 6, szOID_OS_VERSION, 0, (LPCWSTR)IDS_OS_VERSION, NULL },
|
||||
{ 6, szOID_ENROLLMENT_CSP_PROVIDER, 0, (LPCWSTR)IDS_ENROLLMENT_CSP, NULL },
|
||||
{ 6, szOID_CRL_NUMBER, 0, (LPCWSTR)IDS_CRL_NUMBER, NULL },
|
||||
{ 6, szOID_DELTA_CRL_INDICATOR, 0, (LPCWSTR)IDS_DELTA_CRL_INDICATOR, NULL },
|
||||
{ 6, szOID_ISSUING_DIST_POINT, 0, (LPCWSTR)IDS_ISSUING_DIST_POINT, NULL },
|
||||
{ 6, szOID_FRESHEST_CRL, 0, (LPCWSTR)IDS_FRESHEST_CRL, NULL },
|
||||
{ 6, szOID_NAME_CONSTRAINTS, 0, (LPCWSTR)IDS_NAME_CONSTRAINTS, NULL },
|
||||
{ 6, szOID_POLICY_MAPPINGS, 0, (LPCWSTR)IDS_POLICY_MAPPINGS, NULL },
|
||||
{ 6, szOID_LEGACY_POLICY_MAPPINGS, 0, (LPCWSTR)IDS_POLICY_MAPPINGS, NULL },
|
||||
{ 6, szOID_POLICY_CONSTRAINTS, 0, (LPCWSTR)IDS_POLICY_CONSTRAINTS, NULL },
|
||||
{ 6, szOID_CROSS_CERT_DIST_POINTS, 0, (LPCWSTR)IDS_CROSS_CERT_DIST_POINTS, NULL },
|
||||
{ 6, szOID_APPLICATION_CERT_POLICIES, 0, (LPCWSTR)IDS_APPLICATION_POLICIES, NULL },
|
||||
{ 6, szOID_APPLICATION_POLICY_MAPPINGS, 0, (LPCWSTR)IDS_APPLICATION_POLICY_MAPPINGS, NULL },
|
||||
{ 6, szOID_APPLICATION_POLICY_CONSTRAINTS, 0, (LPCWSTR)IDS_APPLICATION_POLICY_CONSTRAINTS, NULL },
|
||||
{ 6, szOID_CT_PKI_DATA, 0, (LPCWSTR)IDS_CMC_DATA, NULL },
|
||||
{ 6, szOID_CT_PKI_RESPONSE, 0, (LPCWSTR)IDS_CMC_RESPONSE, NULL },
|
||||
{ 6, szOID_CMC, 0, (LPCWSTR)IDS_UNSIGNED_CMC_REQUEST, NULL },
|
||||
{ 6, szOID_CMC_STATUS_INFO, 0, (LPCWSTR)IDS_CMC_STATUS_INFO, NULL },
|
||||
{ 6, szOID_CMC_ADD_EXTENSIONS, 0, (LPCWSTR)IDS_CMC_EXTENSIONS, NULL },
|
||||
{ 6, szOID_CTL, 0, (LPCWSTR)IDS_CMC_ATTRIBUTES, NULL },
|
||||
{ 6, szOID_RSA_data, 0, (LPCWSTR)IDS_PKCS_7_DATA, NULL },
|
||||
{ 6, szOID_RSA_signedData, 0, (LPCWSTR)IDS_PKCS_7_SIGNED, NULL },
|
||||
{ 6, szOID_RSA_envelopedData, 0, (LPCWSTR)IDS_PKCS_7_ENVELOPED, NULL },
|
||||
{ 6, szOID_RSA_signEnvData, 0, (LPCWSTR)IDS_PKCS_7_SIGNED_ENVELOPED, NULL },
|
||||
{ 6, szOID_RSA_digestedData, 0, (LPCWSTR)IDS_PKCS_7_DIGESTED, NULL },
|
||||
{ 6, szOID_RSA_encryptedData, 0, (LPCWSTR)IDS_PKCS_7_ENCRYPTED, NULL },
|
||||
{ 6, szOID_CERTSRV_PREVIOUS_CERT_HASH, 0, (LPCWSTR)IDS_PREVIOUS_CA_CERT_HASH, NULL },
|
||||
{ 6, szOID_CRL_VIRTUAL_BASE, 0, (LPCWSTR)IDS_CRL_VIRTUAL_BASE, NULL },
|
||||
{ 6, szOID_CRL_NEXT_PUBLISH, 0, (LPCWSTR)IDS_CRL_NEXT_PUBLISH, NULL },
|
||||
{ 6, szOID_KP_CA_EXCHANGE, 0, (LPCWSTR)IDS_CA_EXCHANGE, NULL },
|
||||
{ 6, szOID_KP_KEY_RECOVERY_AGENT, 0, (LPCWSTR)IDS_KEY_RECOVERY_AGENT, NULL },
|
||||
{ 6, szOID_CERTIFICATE_TEMPLATE, 0, (LPCWSTR)IDS_CERTIFICATE_TEMPLATE, NULL },
|
||||
{ 6, szOID_ENTERPRISE_OID_ROOT, 0, (LPCWSTR)IDS_ENTERPRISE_ROOT_OID, NULL },
|
||||
{ 6, szOID_RDN_DUMMY_SIGNER, 0, (LPCWSTR)IDS_RDN_DUMMY_SIGNER, NULL },
|
||||
{ 6, szOID_ARCHIVED_KEY_ATTR, 0, (LPCWSTR)IDS_ARCHIVED_KEY_ATTR, NULL },
|
||||
{ 6, szOID_CRL_SELF_CDP, 0, (LPCWSTR)IDS_CRL_SELF_CDP, NULL },
|
||||
{ 6, szOID_REQUIRE_CERT_CHAIN_POLICY, 0, (LPCWSTR)IDS_REQUIRE_CERT_CHAIN_POLICY, NULL },
|
||||
{ 6, szOID_CMC_TRANSACTION_ID, 0, (LPCWSTR)IDS_TRANSACTION_ID, NULL },
|
||||
{ 6, szOID_CMC_SENDER_NONCE, 0, (LPCWSTR)IDS_SENDER_NONCE, NULL },
|
||||
{ 6, szOID_CMC_RECIPIENT_NONCE, 0, (LPCWSTR)IDS_RECIPIENT_NONCE, NULL },
|
||||
{ 6, szOID_CMC_REG_INFO, 0, (LPCWSTR)IDS_REG_INFO, NULL },
|
||||
{ 6, szOID_CMC_GET_CERT, 0, (LPCWSTR)IDS_GET_CERTIFICATE, NULL },
|
||||
{ 6, szOID_CMC_GET_CRL, 0, (LPCWSTR)IDS_GET_CRL, NULL },
|
||||
{ 6, szOID_CMC_REVOKE_REQUEST, 0, (LPCWSTR)IDS_REVOKE_REQUEST, NULL },
|
||||
{ 6, szOID_CMC_QUERY_PENDING, 0, (LPCWSTR)IDS_QUERY_PENDING, NULL },
|
||||
{ 6, szOID_SORTED_CTL, 0, (LPCWSTR)IDS_SORTED_CTL, NULL },
|
||||
{ 6, szOID_ARCHIVED_KEY_CERT_HASH, 0, (LPCWSTR)IDS_ARCHIVED_KEY_CERT_HASH, NULL },
|
||||
{ 6, szOID_PRIVATEKEY_USAGE_PERIOD, 0, (LPCWSTR)IDS_PRIVATE_KEY_USAGE_PERIOD, NULL },
|
||||
{ 6, szOID_REQUEST_CLIENT_INFO, 0, (LPCWSTR)IDS_CLIENT_INFORMATION, NULL },
|
||||
|
||||
{ 7, szOID_PKIX_KP_SERVER_AUTH, 0, (LPCWSTR)IDS_SERVER_AUTHENTICATION, NULL },
|
||||
{ 7, szOID_PKIX_KP_CLIENT_AUTH, 0, (LPCWSTR)IDS_CLIENT_AUTHENTICATION, NULL },
|
||||
{ 7, szOID_PKIX_KP_CODE_SIGNING, 0, (LPCWSTR)IDS_CODE_SIGNING, NULL },
|
||||
{ 7, szOID_PKIX_KP_EMAIL_PROTECTION, 0, (LPCWSTR)IDS_SECURE_EMAIL, NULL },
|
||||
{ 7, szOID_PKIX_KP_TIMESTAMP_SIGNING, 0, (LPCWSTR)IDS_TIME_STAMPING, NULL },
|
||||
{ 7, szOID_KP_CTL_USAGE_SIGNING, 0, (LPCWSTR)IDS_MICROSOFT_TRUST_LIST_SIGNING, NULL },
|
||||
{ 7, szOID_KP_TIME_STAMP_SIGNING, 0, (LPCWSTR)IDS_MICROSOFT_TIME_STAMPING, NULL },
|
||||
{ 7, szOID_PKIX_KP_IPSEC_END_SYSTEM, 0, (LPCWSTR)IDS_IPSEC_END_SYSTEM, NULL },
|
||||
{ 7, szOID_PKIX_KP_IPSEC_TUNNEL, 0, (LPCWSTR)IDS_IPSEC_TUNNEL, NULL },
|
||||
{ 7, szOID_PKIX_KP_IPSEC_USER, 0, (LPCWSTR)IDS_IPSEC_USER, NULL },
|
||||
{ 7, szOID_KP_EFS, 0, (LPCWSTR)IDS_EFS, NULL },
|
||||
{ 7, szOID_WHQL_CRYPTO, 0, (LPCWSTR)IDS_WHQL_CRYPTO, NULL },
|
||||
{ 7, szOID_NT5_CRYPTO, 0, (LPCWSTR)IDS_NT5_CRYPTO, NULL },
|
||||
{ 7, szOID_OEM_WHQL_CRYPTO, 0, (LPCWSTR)IDS_OEM_WHQL_CRYPTO, NULL },
|
||||
{ 7, szOID_EMBEDDED_NT_CRYPTO, 0, (LPCWSTR)IDS_EMBEDDED_NT_CRYPTO, NULL },
|
||||
{ 7, szOID_LICENSES, 0, (LPCWSTR)IDS_KEY_PACK_LICENSES, NULL },
|
||||
{ 7, szOID_LICENSE_SERVER, 0, (LPCWSTR)IDS_LICENSE_SERVER, NULL },
|
||||
{ 7, szOID_KP_SMARTCARD_LOGON, 0, (LPCWSTR)IDS_SMART_CARD_LOGON, NULL },
|
||||
{ 7, szOID_DRM, 0, (LPCWSTR)IDS_DIGITAL_RIGHTS, NULL },
|
||||
{ 7, szOID_KP_QUALIFIED_SUBORDINATION, 0, (LPCWSTR)IDS_QUALIFIED_SUBORDINATION, NULL },
|
||||
{ 7, szOID_KP_KEY_RECOVERY, 0, (LPCWSTR)IDS_KEY_RECOVERY, NULL },
|
||||
{ 7, szOID_KP_DOCUMENT_SIGNING, 0, (LPCWSTR)IDS_DOCUMENT_SIGNING, NULL },
|
||||
{ 7, szOID_IPSEC_KP_IKE_INTERMEDIATE, 0, (LPCWSTR)IDS_IPSEC_IKE_INTERMEDIATE, NULL },
|
||||
{ 7, szOID_EFS_RECOVERY, 0, (LPCWSTR)IDS_FILE_RECOVERY, NULL },
|
||||
{ 7, szOID_ROOT_LIST_SIGNER, 0, (LPCWSTR)IDS_ROOT_LIST_SIGNER, NULL },
|
||||
{ 7, szOID_ANY_APPLICATION_POLICY, 0, (LPCWSTR)IDS_ANY_APPLICATION_POLICIES, NULL },
|
||||
{ 7, szOID_DS_EMAIL_REPLICATION, 0, (LPCWSTR)IDS_DS_EMAIL_REPLICATION, NULL },
|
||||
{ 7, szOID_ENROLLMENT_AGENT, 0, (LPCWSTR)IDS_ENROLLMENT_AGENT, NULL },
|
||||
{ 7, szOID_KP_KEY_RECOVERY_AGENT, 0, (LPCWSTR)IDS_KEY_RECOVERY_AGENT, NULL },
|
||||
{ 7, szOID_KP_CA_EXCHANGE, 0, (LPCWSTR)IDS_CA_EXCHANGE, NULL },
|
||||
{ 7, szOID_KP_LIFETIME_SIGNING, 0, (LPCWSTR)IDS_LIFETIME_SIGNING, NULL },
|
||||
|
||||
{ 8, szOID_ANY_CERT_POLICY, 0, (LPCWSTR)IDS_ANY_CERT_POLICY, NULL },
|
||||
};
|
||||
|
||||
static const struct OIDToAlgID oidToAlgID[] = {
|
||||
{ szOID_RSA_RSA, CALG_RSA_KEYX },
|
||||
{ szOID_RSA_MD2RSA, CALG_MD2 },
|
||||
{ szOID_RSA_MD4RSA, CALG_MD4 },
|
||||
{ szOID_RSA_MD5RSA, CALG_MD5 },
|
||||
{ szOID_RSA_SHA1RSA, CALG_SHA },
|
||||
{ szOID_RSA_DH, CALG_DH_SF },
|
||||
{ szOID_RSA_SMIMEalgESDH, CALG_DH_EPHEM },
|
||||
{ szOID_RSA_SMIMEalgCMS3DESwrap, CALG_3DES },
|
||||
{ szOID_RSA_SMIMEalgCMSRC2wrap, CALG_RC2 },
|
||||
{ szOID_RSA_MD2, CALG_MD2 },
|
||||
{ szOID_RSA_MD4, CALG_MD4 },
|
||||
{ szOID_RSA_MD5, CALG_MD5 },
|
||||
{ szOID_RSA_RC2CBC, CALG_RC2 },
|
||||
{ szOID_RSA_RC4, CALG_RC4 },
|
||||
{ szOID_RSA_DES_EDE3_CBC, CALG_3DES },
|
||||
{ szOID_ANSI_X942_DH, CALG_DH_SF },
|
||||
{ szOID_X957_DSA, CALG_DSS_SIGN },
|
||||
{ szOID_X957_SHA1DSA, CALG_SHA },
|
||||
{ szOID_OIWSEC_md4RSA, CALG_MD4 },
|
||||
{ szOID_OIWSEC_md5RSA, CALG_MD5 },
|
||||
{ szOID_OIWSEC_md4RSA2, CALG_MD4 },
|
||||
{ szOID_OIWSEC_desCBC, CALG_DES },
|
||||
{ szOID_OIWSEC_dsa, CALG_DSS_SIGN },
|
||||
{ szOID_OIWSEC_shaDSA, CALG_SHA },
|
||||
{ szOID_OIWSEC_shaRSA, CALG_SHA },
|
||||
{ szOID_OIWSEC_sha, CALG_SHA },
|
||||
{ szOID_OIWSEC_rsaXchg, CALG_RSA_KEYX },
|
||||
{ szOID_OIWSEC_sha1, CALG_SHA },
|
||||
{ szOID_OIWSEC_dsaSHA1, CALG_SHA },
|
||||
{ szOID_OIWSEC_sha1RSASign, CALG_SHA },
|
||||
{ szOID_OIWDIR_md2RSA, CALG_MD2 },
|
||||
{ szOID_INFOSEC_mosaicUpdatedSig, CALG_SHA },
|
||||
{ szOID_INFOSEC_mosaicKMandUpdSig, CALG_DSS_SIGN },
|
||||
struct OIDInfo {
|
||||
CRYPT_OID_INFO info;
|
||||
struct list entry;
|
||||
};
|
||||
|
||||
static void init_oid_info(HINSTANCE hinst)
|
||||
{
|
||||
DWORD i;
|
||||
|
||||
InitializeCriticalSection(&oidInfoCS);
|
||||
list_init(&oidInfo);
|
||||
for (i = 0; i < sizeof(oidInfoConstructors) /
|
||||
sizeof(oidInfoConstructors[0]); i++)
|
||||
{
|
||||
if (HIWORD(oidInfoConstructors[i].pwszName))
|
||||
{
|
||||
struct OIDInfo *info;
|
||||
|
||||
/* The name is a static string, so just use the same pointer */
|
||||
info = CryptMemAlloc(sizeof(struct OIDInfo));
|
||||
if (info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->info.cbSize = sizeof(CRYPT_OID_INFO);
|
||||
info->info.pszOID = oidInfoConstructors[i].pszOID;
|
||||
info->info.pwszName = oidInfoConstructors[i].pwszName;
|
||||
info->info.dwGroupId = oidInfoConstructors[i].dwGroupId;
|
||||
info->info.Algid = oidInfoConstructors[i].Algid;
|
||||
if (oidInfoConstructors[i].blob)
|
||||
{
|
||||
info->info.ExtraInfo.cbData =
|
||||
oidInfoConstructors[i].blob->cbData;
|
||||
info->info.ExtraInfo.pbData =
|
||||
oidInfoConstructors[i].blob->pbData;
|
||||
}
|
||||
list_add_tail(&oidInfo, &info->entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int len = LoadStringW(hinst, (UINT)oidInfoConstructors[i].pwszName,
|
||||
NULL, 0);
|
||||
|
||||
if (len)
|
||||
{
|
||||
struct OIDInfo *info = CryptMemAlloc(sizeof(struct OIDInfo) +
|
||||
(len + 1) * sizeof(WCHAR));
|
||||
|
||||
if (info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->info.cbSize = sizeof(CRYPT_OID_INFO);
|
||||
info->info.pszOID = oidInfoConstructors[i].pszOID;
|
||||
info->info.pwszName =
|
||||
(LPWSTR)((LPBYTE)info + sizeof(struct OIDInfo));
|
||||
info->info.dwGroupId = oidInfoConstructors[i].dwGroupId;
|
||||
info->info.Algid = oidInfoConstructors[i].Algid;
|
||||
LoadStringW(hinst, (UINT)oidInfoConstructors[i].pwszName,
|
||||
(LPWSTR)info->info.pwszName, len + 1);
|
||||
if (oidInfoConstructors[i].blob)
|
||||
{
|
||||
info->info.ExtraInfo.cbData =
|
||||
oidInfoConstructors[i].blob->cbData;
|
||||
info->info.ExtraInfo.pbData =
|
||||
oidInfoConstructors[i].blob->pbData;
|
||||
}
|
||||
list_add_tail(&oidInfo, &info->entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void free_oid_info(void)
|
||||
{
|
||||
struct OIDInfo *info, *next;
|
||||
|
||||
LIST_FOR_EACH_ENTRY_SAFE(info, next, &oidInfo, struct OIDInfo, entry)
|
||||
{
|
||||
list_remove(&info->entry);
|
||||
CryptMemFree(info);
|
||||
}
|
||||
DeleteCriticalSection(&oidInfoCS);
|
||||
}
|
||||
|
||||
BOOL WINAPI CryptEnumOIDInfo(DWORD dwGroupId, DWORD dwFlags, void *pvArg,
|
||||
PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
struct OIDInfo *info;
|
||||
|
||||
TRACE("(%ld, %08lx, %p, %p)\n", dwGroupId, dwFlags, pvArg,
|
||||
pfnEnumOIDInfo);
|
||||
|
||||
EnterCriticalSection(&oidInfoCS);
|
||||
LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
|
||||
{
|
||||
if (!dwGroupId || dwGroupId == info->info.dwGroupId)
|
||||
{
|
||||
ret = pfnEnumOIDInfo(&info->info, pvArg);
|
||||
if (!ret)
|
||||
break;
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&oidInfoCS);
|
||||
return ret;
|
||||
}
|
||||
|
||||
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey,
|
||||
DWORD dwGroupId)
|
||||
{
|
||||
PCCRYPT_OID_INFO ret = NULL;
|
||||
|
||||
TRACE("(%ld, %p, %ld)\n", dwKeyType, pvKey, dwGroupId);
|
||||
|
||||
switch(dwKeyType)
|
||||
{
|
||||
case CRYPT_OID_INFO_ALGID_KEY:
|
||||
{
|
||||
struct OIDInfo *info;
|
||||
|
||||
EnterCriticalSection(&oidInfoCS);
|
||||
LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
|
||||
{
|
||||
if (info->info.Algid == *(DWORD *)pvKey &&
|
||||
(!dwGroupId || info->info.dwGroupId == dwGroupId))
|
||||
{
|
||||
ret = &info->info;
|
||||
break;
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&oidInfoCS);
|
||||
break;
|
||||
}
|
||||
case CRYPT_OID_INFO_NAME_KEY:
|
||||
{
|
||||
struct OIDInfo *info;
|
||||
|
||||
EnterCriticalSection(&oidInfoCS);
|
||||
LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
|
||||
{
|
||||
if (!lstrcmpW(info->info.pwszName, (LPWSTR)pvKey) &&
|
||||
(!dwGroupId || info->info.dwGroupId == dwGroupId))
|
||||
{
|
||||
ret = &info->info;
|
||||
break;
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&oidInfoCS);
|
||||
break;
|
||||
}
|
||||
case CRYPT_OID_INFO_OID_KEY:
|
||||
{
|
||||
struct OIDInfo *info;
|
||||
LPSTR oid = (LPSTR)pvKey;
|
||||
|
||||
EnterCriticalSection(&oidInfoCS);
|
||||
LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
|
||||
{
|
||||
if (!lstrcmpA(info->info.pszOID, oid) &&
|
||||
(!dwGroupId || info->info.dwGroupId == dwGroupId))
|
||||
{
|
||||
ret = &info->info;
|
||||
break;
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&oidInfoCS);
|
||||
break;
|
||||
}
|
||||
case CRYPT_OID_INFO_SIGN_KEY:
|
||||
{
|
||||
struct OIDInfo *info;
|
||||
|
||||
EnterCriticalSection(&oidInfoCS);
|
||||
LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
|
||||
{
|
||||
if (info->info.Algid == *(DWORD *)pvKey &&
|
||||
info->info.ExtraInfo.cbData >= sizeof(DWORD) &&
|
||||
*(DWORD *)info->info.ExtraInfo.pbData ==
|
||||
*(DWORD *)((LPBYTE)pvKey + sizeof(DWORD)) &&
|
||||
(!dwGroupId || info->info.dwGroupId == dwGroupId))
|
||||
{
|
||||
ret = &info->info;
|
||||
break;
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&oidInfoCS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId)
|
||||
{
|
||||
switch (dwAlgId)
|
||||
{
|
||||
case CALG_RSA_KEYX:
|
||||
return szOID_RSA_RSA;
|
||||
case CALG_DH_EPHEM:
|
||||
return szOID_RSA_SMIMEalgESDH;
|
||||
case CALG_MD2:
|
||||
return szOID_RSA_MD2;
|
||||
case CALG_MD4:
|
||||
return szOID_RSA_MD4;
|
||||
case CALG_MD5:
|
||||
return szOID_RSA_MD5;
|
||||
case CALG_RC2:
|
||||
return szOID_RSA_RC2CBC;
|
||||
case CALG_RC4:
|
||||
return szOID_RSA_RC4;
|
||||
case CALG_3DES:
|
||||
return szOID_RSA_DES_EDE3_CBC;
|
||||
case CALG_DH_SF:
|
||||
return szOID_ANSI_X942_DH;
|
||||
case CALG_DSS_SIGN:
|
||||
return szOID_X957_DSA;
|
||||
case CALG_DES:
|
||||
return szOID_OIWSEC_desCBC;
|
||||
case CALG_SHA:
|
||||
return szOID_OIWSEC_sha1;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
LPCSTR ret;
|
||||
PCCRYPT_OID_INFO info = CryptFindOIDInfo(CRYPT_OID_INFO_ALGID_KEY,
|
||||
&dwAlgId, 0);
|
||||
|
||||
if (info)
|
||||
ret = info->pszOID;
|
||||
else
|
||||
ret = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId)
|
||||
{
|
||||
int i;
|
||||
DWORD ret;
|
||||
PCCRYPT_OID_INFO info = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY,
|
||||
(void *)pszObjId, 0);
|
||||
|
||||
if (pszObjId)
|
||||
{
|
||||
for (i = 0; i < sizeof(oidToAlgID) / sizeof(oidToAlgID[0]); i++)
|
||||
{
|
||||
if (!strcmp(pszObjId, oidToAlgID[i].oid))
|
||||
return oidToAlgID[i].algID;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
if (info)
|
||||
ret = info->Algid;
|
||||
else
|
||||
ret = 0;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -314,10 +314,86 @@ static void test_registerOIDFunction(void)
|
|||
ok(ret, "CryptUnregisterOIDFunction failed: %ld\n", GetLastError());
|
||||
}
|
||||
|
||||
static BOOL WINAPI countOidInfo(PCCRYPT_OID_INFO pInfo, void *pvArg)
|
||||
{
|
||||
(*(DWORD *)pvArg)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL WINAPI noOidInfo(PCCRYPT_OID_INFO pInfo, void *pvArg)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void test_enumOIDInfo(void)
|
||||
{
|
||||
BOOL ret;
|
||||
DWORD count = 0;
|
||||
|
||||
/* This crashes
|
||||
ret = CryptEnumOIDInfo(7, 0, NULL, NULL);
|
||||
*/
|
||||
|
||||
/* Silly tests, check that more than one thing is enumerated */
|
||||
ret = CryptEnumOIDInfo(0, 0, &count, countOidInfo);
|
||||
ok(ret && count > 0, "Expected more than item enumerated\n");
|
||||
ret = CryptEnumOIDInfo(0, 0, NULL, noOidInfo);
|
||||
ok(!ret, "Expected FALSE\n");
|
||||
}
|
||||
|
||||
static void test_findOIDInfo(void)
|
||||
{
|
||||
static const WCHAR sha1[] = { 's','h','a','1',0 };
|
||||
ALG_ID alg = CALG_SHA1;
|
||||
ALG_ID algs[2] = { CALG_MD5, CALG_RSA_SIGN };
|
||||
PCCRYPT_OID_INFO info;
|
||||
|
||||
info = CryptFindOIDInfo(0, NULL, 0);
|
||||
ok(info == NULL, "Expected NULL\n");
|
||||
info = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, szOID_RSA_MD5, 0);
|
||||
ok(info != NULL, "Expected to find szOID_RSA_MD5\n");
|
||||
if (info)
|
||||
{
|
||||
ok(!strcmp(info->pszOID, szOID_RSA_MD5), "Expected %s, got %s\n",
|
||||
szOID_RSA_MD5, info->pszOID);
|
||||
ok(info->Algid == CALG_MD5, "Expected CALG_MD5, got %d\n",
|
||||
info->Algid);
|
||||
}
|
||||
info = CryptFindOIDInfo(CRYPT_OID_INFO_NAME_KEY, (void *)sha1, 0);
|
||||
ok(info != NULL, "Expected to find sha1\n");
|
||||
if (info)
|
||||
{
|
||||
ok(!strcmp(info->pszOID, szOID_OIWSEC_sha1), "Expected %s, got %s\n",
|
||||
szOID_OIWSEC_sha1, info->pszOID);
|
||||
ok(info->Algid == CALG_SHA1, "Expected CALG_SHA1, got %d\n",
|
||||
info->Algid);
|
||||
}
|
||||
info = CryptFindOIDInfo(CRYPT_OID_INFO_ALGID_KEY, &alg, 0);
|
||||
ok(info != NULL, "Expected to find sha1\n");
|
||||
if (info)
|
||||
{
|
||||
ok(!strcmp(info->pszOID, szOID_OIWSEC_sha1), "Expected %s, got %s\n",
|
||||
szOID_OIWSEC_sha1, info->pszOID);
|
||||
ok(info->Algid == CALG_SHA1, "Expected CALG_SHA1, got %d\n",
|
||||
info->Algid);
|
||||
}
|
||||
info = CryptFindOIDInfo(CRYPT_OID_INFO_SIGN_KEY, algs, 0);
|
||||
ok(info != NULL, "Expected to find md5RSA\n");
|
||||
if (info)
|
||||
{
|
||||
ok(!strcmp(info->pszOID, szOID_RSA_MD5RSA), "Expected %s, got %s\n",
|
||||
szOID_RSA_MD5RSA, info->pszOID);
|
||||
ok(info->Algid == CALG_MD5, "Expected CALG_MD5, got %d\n",
|
||||
info->Algid);
|
||||
}
|
||||
}
|
||||
|
||||
START_TEST(oid)
|
||||
{
|
||||
testOIDToAlgID();
|
||||
testAlgIDToOID();
|
||||
test_enumOIDInfo();
|
||||
test_findOIDInfo();
|
||||
test_oidFunctionSet();
|
||||
test_installOIDFunctionAddress();
|
||||
test_registerOIDFunction();
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* crypt32 dll version resources
|
||||
*
|
||||
* Copyright (C) 2006 Juan Lang
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define WINE_FILEDESCRIPTION_STR "Wine CryptoAPI Library"
|
||||
#define WINE_FILENAME_STR "crypt32.dll"
|
||||
#define WINE_FILEVERSION 5,131,2600,1243
|
||||
#define WINE_FILEVERSION_STR "5.131.2600.1243"
|
||||
#define WINE_PRODUCTVERSION 5,131,2600,1243
|
||||
#define WINE_PRODUCTVERSION_STR "5.131.2600.1243"
|
||||
|
||||
#include "wine/wine_common_ver.rc"
|
|
@ -1016,6 +1016,7 @@ typedef struct _CRYPT_URL_INFO {
|
|||
#define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF)
|
||||
#define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
|
||||
#define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
|
||||
#define CALG_NO_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY)
|
||||
#define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF)
|
||||
#define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM)
|
||||
#define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
|
||||
|
|
Loading…
Reference in New Issue