ReactOS 0.4.16-dev-1946-g52006dd
str.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winerror.h>
#include <wincrypt.h>
#include <winnls.h>
#include "wine/test.h"
Include dependency graph for str.c:

Go to the source code of this file.

Classes

struct  _CertRDNAttrEncoding
 
struct  _CertRDNAttrEncodingW
 
struct  StrToNameA
 
struct  StrToNameW
 

Macros

#define CERT_V3_SAN_OID_OFFSET   534
 
#define CERT_V3_IAN_OID_OFFSET   565
 
#define test_NameToStrConversionA(a, b, c)   test_NameToStrConversionA_(__LINE__, a, b, c)
 
#define test_NameToStrConversionW(a, b, c)   test_NameToStrConversionW_(__LINE__, a, b, c)
 
#define test_CertGetNameString_value(a, b, c, d, e)   test_CertGetNameString_value_(__LINE__, a, b, c, d, e)
 

Typedefs

typedef struct _CertRDNAttrEncoding CertRDNAttrEncoding
 
typedef struct _CertRDNAttrEncodingPCertRDNAttrEncoding
 
typedef struct _CertRDNAttrEncodingW CertRDNAttrEncodingW
 
typedef struct _CertRDNAttrEncodingWPCertRDNAttrEncodingW
 

Functions

static void test_CertRDNValueToStrA (void)
 
static void test_CertRDNValueToStrW (void)
 
static void test_NameToStrConversionA_ (unsigned int line, PCERT_NAME_BLOB pName, DWORD dwStrType, LPCSTR expected)
 
static void test_CertNameToStrA (void)
 
static void test_NameToStrConversionW_ (unsigned int line, PCERT_NAME_BLOB pName, DWORD dwStrType, LPCWSTR expected)
 
static void test_CertNameToStrW (void)
 
static void test_CertStrToNameA (void)
 
static void test_CertStrToNameW (void)
 
static void test_CertGetNameString_value_ (unsigned int line, PCCERT_CONTEXT context, DWORD type, DWORD flags, void *type_para, const char *expected)
 
static void test_CertGetNameString (void)
 
static void test_quoted_RDN (void)
 
 START_TEST (str)
 

Variables

static BYTE bin1 [] = { 0x55, 0x53 }
 
static BYTE bin2 []
 
static BYTE bin3 []
 
static BYTE bin4 []
 
static BYTE bin5 []
 
static BYTE bin6 []
 
static BYTE bin7 []
 
static BYTE bin8 []
 
static BYTE bin9 [] = { 0x61, 0x62, 0x63, 0x22, 0x64, 0x65, 0x66 }
 
static BYTE bin10 [] = { 0x61, 0x62, 0x63, 0x27, 0x64, 0x65, 0x66 }
 
static BYTE bin11 [] = { 0x61, 0x62, 0x63, 0x2c, 0x20, 0x64, 0x65, 0x66 }
 
static BYTE bin12 [] = { 0x20, 0x61, 0x62, 0x63, 0x20 }
 
static BYTE bin13 [] = { 0x22, 0x64, 0x65, 0x66, 0x22 }
 
static BYTE bin14 [] = { 0x31, 0x3b, 0x33 }
 
static const BYTE cert []
 
static const BYTE cert_no_email []
 
static BYTE cert_v3 []
 
static char issuerStr []
 
static char issuerStrSemicolon []
 
static char issuerStrCRLF []
 
static char subjectStr []
 
static char subjectStrSemicolon []
 
static char subjectStrCRLF []
 
static char x500SubjectStr [] = "C=US, S=Minnesota, L=Minneapolis, O=CodeWeavers, OU=Wine Development, CN=localhost, E=aric@codeweavers.com"
 
static char x500SubjectStrSemicolonReverse [] = "E=aric@codeweavers.com; CN=localhost; OU=Wine Development; O=CodeWeavers; L=Minneapolis; S=Minnesota; C=US"
 
static BYTE encodedSimpleCN []
 
static BYTE encodedSingleQuotedCN []
 
static BYTE encodedSpacedCN []
 
static BYTE encodedQuotedCN []
 
static BYTE encodedMultipleAttrCN []
 
static BYTE encodedCommaCN []
 
static BYTE encodedEqualCN []
 
static BYTE encodedLessThanCN []
 
static BYTE encodedGreaterThanCN []
 
static BYTE encodedHashCN []
 
static BYTE encodedSemiCN []
 
static BYTE encodedNewlineCN []
 
static BYTE encodedDummyCN []
 
static BYTE encodedFields []
 
static const struct StrToNameA namesA []
 
static const BYTE encodedJapaneseCN []
 
static const struct StrToNameW namesW []
 

Macro Definition Documentation

◆ CERT_V3_IAN_OID_OFFSET

#define CERT_V3_IAN_OID_OFFSET   565

Definition at line 297 of file str.c.

◆ CERT_V3_SAN_OID_OFFSET

#define CERT_V3_SAN_OID_OFFSET   534

Definition at line 296 of file str.c.

◆ test_CertGetNameString_value

#define test_CertGetNameString_value (   a,
  b,
  c,
  d,
  e 
)    test_CertGetNameString_value_(__LINE__, a, b, c, d, e)

Definition at line 932 of file str.c.

◆ test_NameToStrConversionA

#define test_NameToStrConversionA (   a,
  b,
  c 
)    test_NameToStrConversionA_(__LINE__, a, b, c)

Definition at line 462 of file str.c.

◆ test_NameToStrConversionW

#define test_NameToStrConversionW (   a,
  b,
  c 
)    test_NameToStrConversionW_(__LINE__, a, b, c)

Definition at line 622 of file str.c.

Typedef Documentation

◆ CertRDNAttrEncoding

◆ CertRDNAttrEncodingW

◆ PCertRDNAttrEncoding

◆ PCertRDNAttrEncodingW

Function Documentation

◆ START_TEST()

START_TEST ( str  )

Definition at line 1227 of file str.c.

1228{
1237}
static void test_quoted_RDN(void)
Definition: str.c:1083
static void test_CertRDNValueToStrW(void)
Definition: str.c:388
static void test_CertNameToStrW(void)
Definition: str.c:649
static void test_CertStrToNameA(void)
Definition: str.c:780
static void test_CertRDNValueToStrA(void)
Definition: str.c:314
static void test_CertStrToNameW(void)
Definition: str.c:883
static void test_CertNameToStrA(void)
Definition: str.c:526
static void test_CertGetNameString(void)
Definition: str.c:1006

◆ test_CertGetNameString()

static void test_CertGetNameString ( void  )
static

Definition at line 1006 of file str.c.

1007{
1008 static const char aric[] = "aric@codeweavers.com";
1009 static const char localhost[] = "localhost";
1011 DWORD len, type;
1012
1014 sizeof(cert));
1015 ok(!!context, "CertCreateCertificateContext failed, err %lu\n", GetLastError());
1016
1017 /* Bad string types/types missing from the cert */
1018 len = CertGetNameStringA(NULL, 0, 0, NULL, NULL, 0);
1019 ok(len == 1, "expected 1, got %lu\n", len);
1020 len = CertGetNameStringA(context, 0, 0, NULL, NULL, 0);
1021 ok(len == 1, "expected 1, got %lu\n", len);
1023 ok(len == 1, "expected 1, got %lu\n", len);
1024
1025 len = CertGetNameStringW(NULL, 0, 0, NULL, NULL, 0);
1026 ok(len == 1, "expected 1, got %lu\n", len);
1027 len = CertGetNameStringW(context, 0, 0, NULL, NULL, 0);
1028 ok(len == 1, "expected 1, got %lu\n", len);
1030 ok(len == 1, "expected 1, got %lu\n", len);
1031
1034 type = 0;
1047
1049
1051 sizeof(cert_no_email));
1052 ok(!!context, "CertCreateCertificateContext failed, err %lu\n", GetLastError());
1053
1055
1057
1058 ok(cert_v3[CERT_V3_SAN_OID_OFFSET] == 0x55, "Incorrect CERT_V3_SAN_OID_OFFSET.\n");
1059 ok(cert_v3[CERT_V3_IAN_OID_OFFSET] == 0x55, "Incorrect CERT_V3_IAN_OID_OFFSET.\n");
1060 cert_v3[CERT_V3_SAN_OID_OFFSET + 2] = 7; /* legacy OID_SUBJECT_ALT_NAME */
1061 cert_v3[CERT_V3_IAN_OID_OFFSET + 2] = 8; /* legacy OID_ISSUER_ALT_NAME */
1063 ok(!!context, "CertCreateCertificateContext failed, err %lu\n", GetLastError());
1067
1068 cert_v3[CERT_V3_SAN_OID_OFFSET + 2] = 17; /* OID_SUBJECT_ALT_NAME2 */
1069 cert_v3[CERT_V3_IAN_OID_OFFSET + 2] = 18; /* OID_ISSUER_ALT_NAME2 */
1071 ok(!!context, "CertCreateCertificateContext failed, err %lu\n", GetLastError());
1077 NULL, "ex1.org\0*.ex2.org\0");
1079 NULL, "ex3.org\0*.ex4.org\0");
1081}
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:371
PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
Definition: cert.c:316
DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, LPSTR pszNameString, DWORD cchNameString)
Definition: str.c:1127
DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString)
Definition: str.c:1228
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
static const BYTE aric[]
Definition: encode.c:682
static const BYTE localhost[]
Definition: encode.c:1391
static BYTE cert[]
Definition: msg.c:1374
static BYTE cert_v3[]
Definition: str.c:228
#define CERT_V3_SAN_OID_OFFSET
Definition: str.c:296
static char subjectStr[]
Definition: str.c:305
static char issuerStr[]
Definition: str.c:299
#define CERT_V3_IAN_OID_OFFSET
Definition: str.c:297
static const BYTE cert_no_email[]
Definition: str.c:159
#define test_CertGetNameString_value(a, b, c, d, e)
Definition: str.c:932
Definition: http.c:7252
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CERT_NAME_SIMPLE_DISPLAY_TYPE
Definition: wincrypt.h:3658
#define CERT_NAME_EMAIL_TYPE
Definition: wincrypt.h:3655
#define X509_ASN_ENCODING
Definition: wincrypt.h:2501
#define CERT_NAME_SEARCH_ALL_NAMES_FLAG
Definition: wincrypt.h:3665
#define szOID_RSA_emailAddr
Definition: wincrypt.h:3188
#define CERT_NAME_DNS_TYPE
Definition: wincrypt.h:3660
#define szOID_SUR_NAME
Definition: wincrypt.h:3291
#define CERT_NAME_RDN_TYPE
Definition: wincrypt.h:3656
#define CERT_NAME_ISSUER_FLAG
Definition: wincrypt.h:3664
#define CERT_NAME_ATTR_TYPE
Definition: wincrypt.h:3657
#define CERT_NAME_URL_TYPE
Definition: wincrypt.h:3661
#define szOID_COMMON_NAME
Definition: wincrypt.h:3290
#define CERT_OID_NAME_STR
Definition: wincrypt.h:3643
#define CERT_NAME_FRIENDLY_DISPLAY_TYPE
Definition: wincrypt.h:3659

Referenced by START_TEST().

◆ test_CertGetNameString_value_()

static void test_CertGetNameString_value_ ( unsigned int  line,
PCCERT_CONTEXT  context,
DWORD  type,
DWORD  flags,
void type_para,
const char expected 
)
static

Definition at line 933 of file str.c.

935{
936 DWORD len, retlen, expected_len;
937 WCHAR expectedW[512];
938 WCHAR strW[512];
939 char str[512];
940
941 expected_len = 0;
942 while(expected[expected_len])
943 {
944 while((expectedW[expected_len] = expected[expected_len]))
945 ++expected_len;
947 break;
948 expectedW[expected_len++] = 0;
949 }
950 expectedW[expected_len++] = 0;
951
952 len = CertGetNameStringA(context, type, flags, type_para, NULL, 0);
953 if (flags & CERT_NAME_SEARCH_ALL_NAMES_FLAG && ((type == CERT_NAME_DNS_TYPE && len < expected_len)
954 || (type != CERT_NAME_DNS_TYPE && len > expected_len)))
955 {
956 /* Supported since Win8. */
957 win_skip("line %u: CERT_NAME_SEARCH_ALL_NAMES_FLAG is not supported.\n", line);
958 return;
959 }
960 ok(len == expected_len, "line %u: unexpected length %ld, expected %ld.\n", line, len, expected_len);
961 memset(str, 0xcc, len);
962 retlen = CertGetNameStringA(context, type, flags, type_para, str, len);
963 ok(retlen == len, "line %u: unexpected len %lu, expected %lu.\n", line, retlen, len);
964 ok(!memcmp(str, expected, expected_len), "line %u: unexpected value %s.\n", line, debugstr_an(str, expected_len));
965 str[0] = str[1] = 0xcc;
966 retlen = CertGetNameStringA(context, type, flags, type_para, str, len - 1);
967 ok(retlen == 1, "line %u: Unexpected len %lu, expected 1.\n", line, retlen);
968 if (len == 1) return;
969 ok(!str[0], "line %u: unexpected str[0] %#x.\n", line, str[0]);
970 ok(str[1] == expected[1], "line %u: unexpected str[1] %#x.\n", line, str[1]);
971 ok(!memcmp(str + 1, expected + 1, len - 2),
972 "line %u: str %s, string data mismatch.\n", line, debugstr_a(str + 1));
973 retlen = CertGetNameStringA(context, type, flags, type_para, str, 0);
974 ok(retlen == len, "line %u: Unexpected len %lu, expected 1.\n", line, retlen);
975
976 memset(strW, 0xcc, len * sizeof(*strW));
977 retlen = CertGetNameStringW(context, type, flags, type_para, strW, len);
978 ok(retlen == expected_len, "line %u: unexpected len %lu, expected %lu.\n", line, retlen, expected_len);
979 ok(!memcmp(strW, expectedW, len * sizeof(*strW)), "line %u: unexpected value %s.\n", line, debugstr_wn(strW, len));
980 strW[0] = strW[1] = 0xcccc;
981 retlen = CertGetNameStringW(context, type, flags, type_para, strW, len - 1);
982 ok(retlen == len - 1, "line %u: unexpected len %lu, expected %lu.\n", line, retlen, len - 1);
984 {
985 ok(!memcmp(strW, expectedW, (retlen - 2) * sizeof(*strW)),
986 "line %u: str %s, string data mismatch.\n", line, debugstr_wn(strW, retlen - 2));
987 ok(!strW[retlen - 2], "line %u: string is not zero terminated.\n", line);
988 ok(!strW[retlen - 1], "line %u: string sequence is not zero terminated.\n", line);
989
990 retlen = CertGetNameStringW(context, type, flags, type_para, strW, 1);
991 ok(retlen == 1, "line %u: unexpected len %lu, expected %lu.\n", line, retlen, len - 1);
992 ok(!strW[retlen - 1], "line %u: string sequence is not zero terminated.\n", line);
993 }
994 else
995 {
996 ok(!memcmp(strW, expectedW, (retlen - 1) * sizeof(*strW)),
997 "line %u: str %s, string data mismatch.\n", line, debugstr_wn(strW, retlen - 1));
998 ok(!strW[retlen - 1], "line %u: string is not zero terminated.\n", line);
999 }
1000 retlen = CertGetNameStringA(context, type, flags, type_para, NULL, len - 1);
1001 ok(retlen == len, "line %u: unexpected len %lu, expected %lu\n", line, retlen, len);
1002 retlen = CertGetNameStringW(context, type, flags, type_para, NULL, len - 1);
1003 ok(retlen == len, "line %u: unexpected len %lu, expected %lu\n", line, retlen, len);
1004}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
GLbitfield flags
Definition: glext.h:7161
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_wn
Definition: kernel32.h:33
#define win_skip
Definition: minitest.h:67
BOOL expected
Definition: store.c:2000
WCHAR strW[12]
Definition: clipboard.c:2025
const WCHAR * str
#define memset(x, y, z)
Definition: compat.h:39
Definition: parser.c:49
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ test_CertNameToStrA()

static void test_CertNameToStrA ( void  )
static

Definition at line 526 of file str.c.

527{
530
532 sizeof(cert));
533 ok(context != NULL, "CertCreateCertificateContext failed: %08lx\n",
534 GetLastError());
535 if (context)
536 {
537 DWORD ret;
538
539 /* This crashes
540 ret = CertNameToStrA(0, NULL, 0, NULL, 0);
541 */
542 /* Test with a bogus encoding type */
543 SetLastError(0xdeadbeef);
544 ret = CertNameToStrA(0, &context->pCertInfo->Issuer, 0, NULL, 0);
546 "Expected retval 1 and ERROR_FILE_NOT_FOUND, got %ld - %08lx\n",
547 ret, GetLastError());
548 SetLastError(0xdeadbeef);
549 ret = CertNameToStrA(X509_ASN_ENCODING, &context->pCertInfo->Issuer,
550 0, NULL, 0);
552 "Expected positive return and ERROR_SUCCESS, got %ld - %08lx\n",
553 ret, GetLastError());
554
556 test_NameToStrConversionA(&context->pCertInfo->Issuer,
558 test_NameToStrConversionA(&context->pCertInfo->Issuer,
561 test_NameToStrConversionA(&context->pCertInfo->Subject,
563 test_NameToStrConversionA(&context->pCertInfo->Subject,
565 test_NameToStrConversionA(&context->pCertInfo->Subject,
567 test_NameToStrConversionA(&context->pCertInfo->Subject,
570
572 }
573 blob.pbData = encodedSimpleCN;
574 blob.cbData = sizeof(encodedSimpleCN);
577 blob.cbData = sizeof(encodedSingleQuotedCN);
580 blob.pbData = encodedSpacedCN;
581 blob.cbData = sizeof(encodedSpacedCN);
584 blob.pbData = encodedQuotedCN;
585 blob.cbData = sizeof(encodedQuotedCN);
589 blob.cbData = sizeof(encodedMultipleAttrCN);
592 blob.pbData = encodedCommaCN;
593 blob.cbData = sizeof(encodedCommaCN);
596 blob.pbData = encodedEqualCN;
597 blob.cbData = sizeof(encodedEqualCN);
600 blob.pbData = encodedLessThanCN;
601 blob.cbData = sizeof(encodedLessThanCN);
604 blob.pbData = encodedGreaterThanCN;
605 blob.cbData = sizeof(encodedGreaterThanCN);
608 blob.pbData = encodedHashCN;
609 blob.cbData = sizeof(encodedHashCN);
612 blob.pbData = encodedSemiCN;
613 blob.cbData = sizeof(encodedSemiCN);
616 blob.pbData = encodedNewlineCN;
617 blob.cbData = sizeof(encodedNewlineCN);
620}
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI CertNameToStrA(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, DWORD dwStrType, LPSTR psz, DWORD csz)
Definition: str.c:414
#define SetLastError(x)
Definition: compat.h:752
return ret
Definition: mutex.c:146
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static BYTE encodedQuotedCN[]
Definition: str.c:491
static BYTE encodedLessThanCN[]
Definition: str.c:501
static BYTE encodedSpacedCN[]
Definition: str.c:489
static char x500SubjectStr[]
Definition: str.c:311
static char issuerStrSemicolon[]
Definition: str.c:301
static BYTE encodedEqualCN[]
Definition: str.c:498
static BYTE encodedSimpleCN[]
Definition: str.c:485
static BYTE encodedGreaterThanCN[]
Definition: str.c:504
static BYTE encodedNewlineCN[]
Definition: str.c:513
static BYTE encodedSemiCN[]
Definition: str.c:510
static char x500SubjectStrSemicolonReverse[]
Definition: str.c:312
static BYTE encodedCommaCN[]
Definition: str.c:495
static BYTE encodedMultipleAttrCN[]
Definition: str.c:493
static char subjectStrCRLF[]
Definition: str.c:309
static BYTE encodedSingleQuotedCN[]
Definition: str.c:487
#define test_NameToStrConversionA(a, b, c)
Definition: str.c:462
static char subjectStrSemicolon[]
Definition: str.c:307
static BYTE encodedHashCN[]
Definition: str.c:507
static char issuerStrCRLF[]
Definition: str.c:303
Definition: image.c:134
#define CERT_X500_NAME_STR
Definition: wincrypt.h:3644
#define CERT_NAME_STR_SEMICOLON_FLAG
Definition: wincrypt.h:3645
#define CERT_SIMPLE_NAME_STR
Definition: wincrypt.h:3642
#define CERT_NAME_STR_CRLF_FLAG
Definition: wincrypt.h:3648
#define CERT_NAME_STR_REVERSE_FLAG
Definition: wincrypt.h:3650

Referenced by START_TEST().

◆ test_CertNameToStrW()

static void test_CertNameToStrW ( void  )
static

Definition at line 649 of file str.c.

650{
653
655 sizeof(cert));
656 ok(context != NULL, "CertCreateCertificateContext failed: %08lx\n",
657 GetLastError());
658 if (context)
659 {
660 DWORD ret;
661
662 /* This crashes
663 ret = CertNameToStrW(0, NULL, 0, NULL, 0);
664 */
665 /* Test with a bogus encoding type */
666 SetLastError(0xdeadbeef);
667 ret = CertNameToStrW(0, &context->pCertInfo->Issuer, 0, NULL, 0);
669 "Expected retval 1 and ERROR_FILE_NOT_FOUND, got %ld - %08lx\n",
670 ret, GetLastError());
671 SetLastError(0xdeadbeef);
672 ret = CertNameToStrW(X509_ASN_ENCODING, &context->pCertInfo->Issuer,
673 0, NULL, 0);
675 "Expected positive return and ERROR_SUCCESS, got %ld - %08lx\n",
676 ret, GetLastError());
677
678 test_NameToStrConversionW(&context->pCertInfo->Issuer,
680 L"US, Minnesota, Minneapolis, CodeWeavers, Wine Development, localhost, aric@codeweavers.com");
681 test_NameToStrConversionW(&context->pCertInfo->Issuer,
683 L"US; Minnesota; Minneapolis; CodeWeavers; Wine Development; localhost; aric@codeweavers.com");
684 test_NameToStrConversionW(&context->pCertInfo->Issuer,
686 L"US\r\nMinnesota\r\nMinneapolis\r\nCodeWeavers\r\nWine Development\r\nlocalhost\r\naric@codeweavers.com");
687 test_NameToStrConversionW(&context->pCertInfo->Subject,
689 L"2.5.4.6=US, 2.5.4.8=Minnesota, 2.5.4.7=Minneapolis, 2.5.4.10=CodeWeavers, 2.5.4.11=Wine Development,"
690 " 2.5.4.3=localhost, 1.2.840.113549.1.9.1=aric@codeweavers.com");
691 test_NameToStrConversionW(&context->pCertInfo->Subject,
693 L"2.5.4.6=US; 2.5.4.8=Minnesota; 2.5.4.7=Minneapolis; 2.5.4.10=CodeWeavers; 2.5.4.11=Wine Development;"
694 " 2.5.4.3=localhost; 1.2.840.113549.1.9.1=aric@codeweavers.com");
695 test_NameToStrConversionW(&context->pCertInfo->Subject,
697 L"2.5.4.6=US\r\n2.5.4.8=Minnesota\r\n2.5.4.7=Minneapolis\r\n2.5.4.10=CodeWeavers\r\n2.5.4.11=Wine "
698 "Development\r\n2.5.4.3=localhost\r\n1.2.840.113549.1.9.1=aric@codeweavers.com");
699 test_NameToStrConversionW(&context->pCertInfo->Subject,
701 L"E=aric@codeweavers.com; CN=localhost; OU=Wine Development; O=CodeWeavers; L=Minneapolis; S=Minnesota; "
702 "C=US");
703
705 }
706 blob.pbData = encodedSimpleCN;
707 blob.cbData = sizeof(encodedSimpleCN);
710 blob.cbData = sizeof(encodedSingleQuotedCN);
713 blob.pbData = encodedSpacedCN;
714 blob.cbData = sizeof(encodedSpacedCN);
717 blob.pbData = encodedQuotedCN;
718 blob.cbData = sizeof(encodedQuotedCN);
722 blob.cbData = sizeof(encodedMultipleAttrCN);
725 blob.pbData = encodedCommaCN;
726 blob.cbData = sizeof(encodedCommaCN);
729 blob.pbData = encodedEqualCN;
730 blob.cbData = sizeof(encodedEqualCN);
733 blob.pbData = encodedLessThanCN;
734 blob.cbData = sizeof(encodedLessThanCN);
737 blob.pbData = encodedGreaterThanCN;
738 blob.cbData = sizeof(encodedGreaterThanCN);
741 blob.pbData = encodedHashCN;
742 blob.cbData = sizeof(encodedHashCN);
745 blob.pbData = encodedSemiCN;
746 blob.cbData = sizeof(encodedSemiCN);
749 blob.pbData = encodedNewlineCN;
750 blob.cbData = sizeof(encodedNewlineCN);
753}
DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, DWORD dwStrType, LPWSTR psz, DWORD csz)
Definition: str.c:702
#define L(x)
Definition: resources.c:13
#define test_NameToStrConversionW(a, b, c)
Definition: str.c:622

Referenced by START_TEST().

◆ test_CertRDNValueToStrA()

static void test_CertRDNValueToStrA ( void  )
static

Definition at line 314 of file str.c.

315{
316 CertRDNAttrEncoding attrs[] = {
317 { "2.5.4.6", CERT_RDN_PRINTABLE_STRING,
318 { sizeof(bin1), bin1 }, "US" },
319 { "2.5.4.8", CERT_RDN_PRINTABLE_STRING,
320 { sizeof(bin2), bin2 }, "Minnesota" },
321 { "2.5.4.7", CERT_RDN_PRINTABLE_STRING,
322 { sizeof(bin3), bin3 }, "Minneapolis" },
323 { "2.5.4.10", CERT_RDN_PRINTABLE_STRING,
324 { sizeof(bin4), bin4 }, "CodeWeavers" },
325 { "2.5.4.11", CERT_RDN_PRINTABLE_STRING,
326 { sizeof(bin5), bin5 }, "Wine Development" },
327 { "2.5.4.3", CERT_RDN_PRINTABLE_STRING,
328 { sizeof(bin6), bin6 }, "localhost" },
329 { "1.2.840.113549.1.9.1", CERT_RDN_IA5_STRING,
330 { sizeof(bin7), bin7 }, "aric@codeweavers.com" },
332 { sizeof(bin9), bin9 }, "abc\"def" },
334 { sizeof(bin10), bin10 }, "abc'def" },
336 { sizeof(bin11), bin11 }, "abc, def" },
338 { sizeof(bin12), bin12 }, " abc " },
340 { sizeof(bin13), bin13 }, "\"def\"" },
342 { sizeof(bin14), bin14 }, "1;3" },
343 };
344 unsigned int i;
345 DWORD ret, len;
346 char buffer[2000];
348 static const char ePKI[] = "ePKI Root Certification Authority";
349
350 /* This crashes
351 ret = CertRDNValueToStrA(0, NULL, NULL, 0);
352 */
353 /* With empty input, it generates the empty string */
354 SetLastError(0xdeadbeef);
355 ret = CertRDNValueToStrA(0, &blob, NULL, 0);
356 ok(ret == 1 && GetLastError() == 0xdeadbeef, "Expected empty string\n");
357 ret = CertRDNValueToStrA(0, &blob, buffer, sizeof(buffer));
358 ok(ret == 1 && GetLastError() == 0xdeadbeef, "Expected empty string\n");
359 ok(!buffer[0], "Expected empty string\n");
360
361 for (i = 0; i < ARRAY_SIZE(attrs); i++)
362 {
363 len = CertRDNValueToStrA(attrs[i].dwValueType, &attrs[i].Value,
364 buffer, sizeof(buffer));
365 ok(len == strlen(attrs[i].str) + 1, "Expected length %d, got %ld\n",
366 lstrlenA(attrs[i].str) + 1, ret);
367 ok(!strcmp(buffer, attrs[i].str), "Expected %s, got %s\n",
368 attrs[i].str, buffer);
369 memset(buffer, 0xcc, sizeof(buffer));
370 ret = CertRDNValueToStrA(attrs[i].dwValueType, &attrs[i].Value, buffer, len - 1);
371 ok(ret == 1, "Unexpected ret %lu, expected 1, test %u.\n", ret, i);
372 ok(!buffer[0], "Unexpected value %#x, test %u.\n", buffer[0], i);
373 ok(!strncmp(buffer + 1, attrs[i].str + 1, len - 2), "Strings do not match, test %u.\n", i);
374 memset(buffer, 0xcc, sizeof(buffer));
375 ret = CertRDNValueToStrA(attrs[i].dwValueType, &attrs[i].Value, buffer, 0);
376 ok(ret == len, "Unexpected ret %lu, expected %lu, test %u.\n", ret, len, i);
377 ok((unsigned char)buffer[0] == 0xcc, "Unexpected value %#x, test %u.\n", buffer[0], i);
378 }
379 blob.pbData = bin8;
380 blob.cbData = sizeof(bin8);
382 sizeof(buffer));
383 ok(ret == strlen(ePKI) + 1, "Expected length %d, got %ld\n", lstrlenA(ePKI), ret);
384 if (ret == strlen(ePKI) + 1)
385 ok(!strcmp(buffer, ePKI), "Expected %s, got %s\n", ePKI, buffer);
386}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define ARRAY_SIZE(A)
Definition: main.h:20
DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, LPSTR psz, DWORD csz)
Definition: str.c:33
GLuint buffer
Definition: glext.h:5915
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static BYTE bin7[]
Definition: str.c:55
static BYTE bin5[]
Definition: str.c:51
static BYTE bin11[]
Definition: str.c:65
static BYTE bin2[]
Definition: str.c:45
static BYTE bin13[]
Definition: str.c:67
static BYTE bin10[]
Definition: str.c:64
static BYTE bin3[]
Definition: str.c:47
static BYTE bin12[]
Definition: str.c:66
static BYTE bin14[]
Definition: str.c:68
static BYTE bin1[]
Definition: str.c:44
static BYTE bin4[]
Definition: str.c:49
static BYTE bin6[]
Definition: str.c:53
static BYTE bin8[]
Definition: str.c:57
static BYTE bin9[]
Definition: str.c:63
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
#define CERT_RDN_UTF8_STRING
Definition: wincrypt.h:2940
#define CERT_RDN_IA5_STRING
Definition: wincrypt.h:2931
#define CERT_RDN_PRINTABLE_STRING
Definition: wincrypt.h:2927

Referenced by START_TEST().

◆ test_CertRDNValueToStrW()

static void test_CertRDNValueToStrW ( void  )
static

Definition at line 388 of file str.c.

389{
390 static const WCHAR ePKIW[] = L"ePKI Root Certification Authority";
391 CertRDNAttrEncodingW attrs[] = {
392 { "2.5.4.6", CERT_RDN_PRINTABLE_STRING,
393 { sizeof(bin1), bin1 }, L"US" },
394 { "2.5.4.8", CERT_RDN_PRINTABLE_STRING,
395 { sizeof(bin2), bin2 }, L"Minnesota" },
396 { "2.5.4.7", CERT_RDN_PRINTABLE_STRING,
397 { sizeof(bin3), bin3 }, L"Minneapolis" },
398 { "2.5.4.10", CERT_RDN_PRINTABLE_STRING,
399 { sizeof(bin4), bin4 }, L"CodeWeavers" },
400 { "2.5.4.11", CERT_RDN_PRINTABLE_STRING,
401 { sizeof(bin5), bin5 }, L"Wine Development" },
402 { "2.5.4.3", CERT_RDN_PRINTABLE_STRING,
403 { sizeof(bin6), bin6 }, L"localhost" },
404 { "1.2.840.113549.1.9.1", CERT_RDN_IA5_STRING,
405 { sizeof(bin7), bin7 }, L"aric@codeweavers.com" },
407 { sizeof(bin9), bin9 }, L"abc\"def" },
409 { sizeof(bin10), bin10 }, L"abc'def" },
411 { sizeof(bin11), bin11 }, L"abc, def" },
413 { sizeof(bin12), bin12 }, L" abc " },
415 { sizeof(bin13), bin13 }, L"\"def\"" },
417 { sizeof(bin14), bin14 }, L"1;3" },
418 };
419 unsigned int i;
420 DWORD ret, len;
421 WCHAR buffer[2000];
423
424 /* This crashes
425 ret = CertRDNValueToStrW(0, NULL, NULL, 0);
426 */
427 /* With empty input, it generates the empty string */
428 SetLastError(0xdeadbeef);
429 ret = CertRDNValueToStrW(0, &blob, NULL, 0);
430 ok(ret == 1 && GetLastError() == 0xdeadbeef, "Expected empty string\n");
432 ok(ret == 1 && GetLastError() == 0xdeadbeef, "Expected empty string\n");
433 ok(!buffer[0], "Expected empty string\n");
434
435 for (i = 0; i < ARRAY_SIZE(attrs); i++)
436 {
437 len = CertRDNValueToStrW(attrs[i].dwValueType, &attrs[i].Value, buffer, ARRAY_SIZE(buffer));
438 ok(len == lstrlenW(attrs[i].str) + 1,
439 "Expected length %d, got %ld\n", lstrlenW(attrs[i].str) + 1, ret);
440 ok(!lstrcmpW(buffer, attrs[i].str), "Expected %s, got %s\n",
442 memset(buffer, 0xcc, sizeof(buffer));
443 ret = CertRDNValueToStrW(attrs[i].dwValueType, &attrs[i].Value, buffer, len - 1);
444 ok(ret == 1, "Unexpected ret %lu, expected 1, test %u.\n", ret, i);
445 ok(!buffer[0], "Unexpected value %#x, test %u.\n", buffer[0], i);
446 ok(buffer[1] == 0xcccc, "Unexpected value %#x, test %u.\n", buffer[1], i);
447 memset(buffer, 0xcc, sizeof(buffer));
448 ret = CertRDNValueToStrW(attrs[i].dwValueType, &attrs[i].Value, buffer, 0);
449 ok(ret == len, "Unexpected ret %lu, expected %lu, test %u.\n", ret, len, i);
450 ok(buffer[0] == 0xcccc, "Unexpected value %#x, test %u.\n", buffer[0], i);
451 }
452 blob.pbData = bin8;
453 blob.cbData = sizeof(bin8);
455 sizeof(buffer));
456 ok(ret == lstrlenW(ePKIW) + 1, "Expected length %d, got %ld\n", lstrlenW(ePKIW), ret);
457 if (ret == lstrlenW(ePKIW) + 1)
458 ok(!lstrcmpW(buffer, ePKIW), "Expected %s, got %s\n",
460}
DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, LPWSTR psz, DWORD csz)
Definition: str.c:100
#define lstrlenW
Definition: compat.h:750
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4246
#define wine_dbgstr_w
Definition: kernel32.h:34

Referenced by START_TEST().

◆ test_CertStrToNameA()

static void test_CertStrToNameA ( void  )
static

Definition at line 780 of file str.c.

781{
782 BOOL ret;
783 DWORD size, i;
784 BYTE buf[100];
785
786 /* Crash
787 ret = CertStrToNameA(0, NULL, 0, NULL, NULL, NULL, NULL);
788 */
789 ret = CertStrToNameA(0, NULL, 0, NULL, NULL, &size, NULL);
790 ok(!ret, "Expected failure\n");
791 ret = CertStrToNameA(0, "bogus", 0, NULL, NULL, &size, NULL);
793 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
794 ret = CertStrToNameA(0, "foo=1", 0, NULL, NULL, &size, NULL);
796 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
797 ret = CertStrToNameA(0, "CN=1", 0, NULL, NULL, &size, NULL);
799 "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError());
801 ok(ret, "CertStrToNameA failed: %08lx\n", GetLastError());
802 size = sizeof(buf);
803 ret = CertStrToNameA(X509_ASN_ENCODING, "CN=\"\"1\"\"", 0, NULL, buf, &size,
804 NULL);
806 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
808 &size, NULL);
810 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
812 &size, NULL);
814 "Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
816 &size, NULL);
818 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
820 &size, NULL);
822 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
824 &size, NULL);
826 "Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
828 &size, NULL);
830 "Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
831 ret = CertStrToNameA(X509_ASN_ENCODING, "CN=\"abc\"", 0, NULL, buf,
832 &size, NULL);
834 "Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
836 &size, NULL);
838 "Expected ERROR_MORE_DATA, got %08lx\n", GetLastError());
839 for (i = 0; i < ARRAY_SIZE(namesA); i++)
840 {
841 size = sizeof(buf);
843 &size, NULL);
844 ok(ret, "CertStrToNameA failed on string %s: %08lx\n", namesA[i].x500,
845 GetLastError());
846 ok(size == namesA[i].encodedSize,
847 "Expected size %ld, got %ld\n", namesA[i].encodedSize, size);
848 if (ret)
849 ok(!memcmp(buf, namesA[i].encoded, namesA[i].encodedSize),
850 "Unexpected value for string %s\n", namesA[i].x500);
851 }
852}
#define ERROR_MORE_DATA
Definition: dderror.h:13
BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500, DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded, LPCSTR *ppszError)
Definition: str.c:716
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static const struct StrToNameA namesA[]
Definition: str.c:762
#define CERT_NAME_STR_NO_QUOTING_FLAG
Definition: wincrypt.h:3647
#define CERT_NAME_STR_NO_PLUS_FLAG
Definition: wincrypt.h:3646
#define CRYPT_E_INVALID_X500_STRING
Definition: winerror.h:4441
unsigned char BYTE
Definition: xxhash.c:193

Referenced by START_TEST().

◆ test_CertStrToNameW()

static void test_CertStrToNameW ( void  )
static

Definition at line 883 of file str.c.

884{
885 BOOL ret;
886 DWORD size, i;
887 LPCWSTR errorPtr;
888 BYTE buf[100];
889
890 /* Crash
891 ret = CertStrToNameW(0, NULL, 0, NULL, NULL, NULL, NULL);
892 */
893 ret = CertStrToNameW(0, NULL, 0, NULL, NULL, &size, NULL);
894 ok(!ret, "Expected failure\n");
895 ret = CertStrToNameW(0, L"bogus", 0, NULL, NULL, &size, NULL);
897 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
898 ret = CertStrToNameW(0, L"foo=1", 0, NULL, NULL, &size, NULL);
900 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
901 ret = CertStrToNameW(0, L"CN=1", 0, NULL, NULL, &size, NULL);
903 "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError());
905 NULL);
906 ok(ret, "CertStrToNameW failed: %08lx\n", GetLastError());
907 size = sizeof(buf);
908 ret = CertStrToNameW(X509_ASN_ENCODING, L"CN=\"\"1\"\"", 0, NULL, buf,
909 &size, NULL);
911 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
912 ret = CertStrToNameW(X509_ASN_ENCODING, L"CN=\"\"1\"\"", 0, NULL, buf,
913 &size, &errorPtr);
915 "Expected CRYPT_E_INVALID_X500_STRING, got %08lx\n", GetLastError());
916 ok(errorPtr && *errorPtr == '1', "Expected first error character was 1\n");
917 for (i = 0; i < ARRAY_SIZE(namesW); i++)
918 {
919 size = sizeof(buf);
921 &size, NULL);
922 ok(ret, "Index %ld: CertStrToNameW failed: %08lx\n", i, GetLastError());
923 ok(size == namesW[i].encodedSize,
924 "Index %ld: expected size %ld, got %ld\n", i, namesW[i].encodedSize,
925 size);
926 if (ret)
927 ok(!memcmp(buf, namesW[i].encoded, size),
928 "Index %ld: unexpected value for string %s\n", i, wine_dbgstr_w(namesW[i].x500));
929 }
930}
BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500, DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded, LPCWSTR *ppszError)
Definition: str.c:1024
static const struct StrToNameW namesW[]
Definition: str.c:864
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by START_TEST().

◆ test_NameToStrConversionA_()

static void test_NameToStrConversionA_ ( unsigned int  line,
PCERT_NAME_BLOB  pName,
DWORD  dwStrType,
LPCSTR  expected 
)
static

Definition at line 463 of file str.c.

464{
465 char buffer[2000];
466 DWORD len, retlen;
467
468 len = CertNameToStrA(X509_ASN_ENCODING, pName, dwStrType, NULL, 0);
469 ok(len == strlen(expected) + 1, "line %u: Expected %d chars, got %ld.\n", line, lstrlenA(expected) + 1, len);
470 len = CertNameToStrA(X509_ASN_ENCODING,pName, dwStrType, buffer, sizeof(buffer));
471 ok(len == strlen(expected) + 1, "line %u: Expected %d chars, got %ld.\n", line, lstrlenA(expected) + 1, len);
472 ok(!strcmp(buffer, expected), "line %u: Expected %s, got %s.\n", line, expected, buffer);
473
474 memset(buffer, 0xcc, sizeof(buffer));
475 retlen = CertNameToStrA(X509_ASN_ENCODING, pName, dwStrType, buffer, len - 1);
476 ok(retlen == 1, "line %u: expected 1, got %lu\n", line, retlen);
477 ok(!buffer[0], "line %u: string is not zero terminated.\n", line);
478
479 memset(buffer, 0xcc, sizeof(buffer));
480 retlen = CertNameToStrA(X509_ASN_ENCODING, pName, dwStrType, buffer, 0);
481 ok(retlen == len, "line %u: expected %lu chars, got %lu\n", line, len - 1, retlen);
482 ok((unsigned char)buffer[0] == 0xcc, "line %u: got %s\n", line, wine_dbgstr_a(buffer));
483}
static LPSTR pName
Definition: security.c:75
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
Definition: debug.h:187

◆ test_NameToStrConversionW_()

static void test_NameToStrConversionW_ ( unsigned int  line,
PCERT_NAME_BLOB  pName,
DWORD  dwStrType,
LPCWSTR  expected 
)
static

Definition at line 623 of file str.c.

624{
625 DWORD len, retlen, expected_len;
626 WCHAR buffer[2000];
627
628 expected_len = wcslen(expected) + 1;
629 memset(buffer, 0xcc, sizeof(buffer));
630 len = CertNameToStrW(X509_ASN_ENCODING, pName, dwStrType, NULL, 0);
631 ok(len == expected_len, "line %u: expected %lu chars, got %lu\n", line, expected_len, len);
633 ok(retlen == len, "line %u: expected %lu chars, got %lu.\n", line, len, retlen);
634 ok(!wcscmp(buffer, expected), "Expected %s, got %s\n", wine_dbgstr_w(expected), wine_dbgstr_w(buffer));
635
636 memset(buffer, 0xcc, sizeof(buffer));
637 retlen = CertNameToStrW(X509_ASN_ENCODING, pName, dwStrType, buffer, len - 1);
638 ok(retlen == len - 1, "line %u: expected %lu chars, got %lu\n", line, len - 1, retlen);
639 ok(!wcsncmp(buffer, expected, retlen - 1), "line %u: expected %s, got %s\n",
641 ok(!buffer[retlen - 1], "line %u: string is not zero terminated.\n", line);
642
643 memset(buffer, 0xcc, sizeof(buffer));
644 retlen = CertNameToStrW(X509_ASN_ENCODING, pName, dwStrType, buffer, 0);
645 ok(retlen == len, "line %u: expected %lu chars, got %lu\n", line, len - 1, retlen);
646 ok(buffer[0] == 0xcccc, "line %u: got %s\n", line, wine_dbgstr_w(buffer));
647}
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)

◆ test_quoted_RDN()

static void test_quoted_RDN ( void  )
static

Definition at line 1083 of file str.c.

1084{
1085 static const WCHAR str1[] = { '1',0x00a0,0 };
1086 static const WCHAR str2[] = { '1',0x3000,0 };
1087 static const struct
1088 {
1089 const WCHAR *CN;
1090 const WCHAR *X500_CN;
1091 } test[] =
1092 {
1093 { L"1", L"1" },
1094 { L" 1", L"\" 1\"" },
1095 { L"1 ", L"\"1 \"" },
1096 { L"\"1\"", L"\"\"\"1\"\"\"" },
1097 { L"\" 1 \"", L"\"\"\" 1 \"\"\"" },
1098 { L"\"\"\"1\"\"\"", L"\"\"\"\"\"\"\"1\"\"\"\"\"\"\"" },
1099 { L"1+", L"\"1+\"" },
1100 { L"1=", L"\"1=\"" },
1101 { L"1\"", L"\"1\"\"\"" },
1102 { L"1<", L"\"1<\"" },
1103 { L"1>", L"\"1>\"" },
1104 { L"1#", L"\"1#\"" },
1105 { L"1+", L"\"1+\"" },
1106 { L"1\t", L"\"1\t\"" },
1107 { L"1\r", L"\"1\r\"" },
1108 { L"1\n", L"\"1\n\"" },
1109 { str1, str1 },
1110 { str2, str2 },
1111 };
1113 CERT_RDN rdn;
1116 BYTE *buf;
1117 WCHAR str[256];
1118 DWORD size, ret, i;
1119
1120 for (i = 0; i < ARRAY_SIZE(test); i++)
1121 {
1122 winetest_push_context("%lu", i);
1123
1124 attr.pszObjId = (LPSTR)szOID_COMMON_NAME;
1125 attr.dwValueType = CERT_RDN_UNICODE_STRING;
1126 attr.Value.cbData = wcslen(test[i].CN) * sizeof(WCHAR);
1127 attr.Value.pbData = (BYTE *)test[i].CN;
1128 rdn.cRDNAttr = 1;
1129 rdn.rgRDNAttr = &attr;
1130 info.cRDN = 1;
1131 info.rgRDN = &rdn;
1132 buf = NULL;
1133 size = 0;
1135 ok(ret, "CryptEncodeObjectEx error %08lx\n", GetLastError());
1136
1137 blob.pbData = buf;
1138 blob.cbData = size;
1139
1140 str[0] = 0;
1142 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1143 ok(!wcscmp(str, test[i].X500_CN), "got %s, expected %s\n", debugstr_w(str), debugstr_w(test[i].X500_CN));
1144
1145 str[0] = 0;
1147 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1148 ok(!wcscmp(str, test[i].X500_CN), "got %s, expected %s\n", debugstr_w(str), debugstr_w(test[i].X500_CN));
1149
1150 str[0] = 0;
1152 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1153 ok(!wcsncmp(str, L"2.5.4.3=", 8), "got %s\n", debugstr_w(str));
1154 ok(!wcscmp(&str[8], test[i].X500_CN), "got %s, expected %s\n", debugstr_w(&str[8]), debugstr_w(test[i].X500_CN));
1155
1156 str[0] = 0;
1158 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1159 ok(!wcsncmp(str, L"CN=", 3), "got %s\n", debugstr_w(str));
1160 ok(!wcscmp(&str[3], test[i].X500_CN), "got %s, expected %s\n", debugstr_w(&str[3]), debugstr_w(test[i].X500_CN));
1161
1162 str[0] = 0;
1164 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1165 ok(!wcsncmp(str, L"CN=", 3), "got %s\n", debugstr_w(str));
1166 ok(!wcscmp(&str[3], test[i].CN), "got %s, expected %s\n", debugstr_w(&str[3]), debugstr_w(test[i].CN));
1167
1168 LocalFree(buf);
1169
1171 }
1172
1173 for (i = 0; i < ARRAY_SIZE(test); i++)
1174 {
1175 winetest_push_context("%lu", i);
1176
1177 attr.pszObjId = (LPSTR)szOID_COMMON_NAME;
1178 attr.dwValueType = CERT_RDN_UTF8_STRING;
1179 attr.Value.cbData = wcslen(test[i].CN) * sizeof(WCHAR);
1180 attr.Value.pbData = (BYTE *)test[i].CN;
1181 rdn.cRDNAttr = 1;
1182 rdn.rgRDNAttr = &attr;
1183 info.cRDN = 1;
1184 info.rgRDN = &rdn;
1185 buf = NULL;
1186 size = 0;
1188 ok(ret, "CryptEncodeObjectEx error %08lx\n", GetLastError());
1189
1190 blob.pbData = buf;
1191 blob.cbData = size;
1192
1193 str[0] = 0;
1195 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1196 ok(!wcscmp(str, test[i].X500_CN), "got %s, expected %s\n", debugstr_w(str), debugstr_w(test[i].X500_CN));
1197
1198 str[0] = 0;
1200 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1201 ok(!wcscmp(str, test[i].X500_CN), "got %s, expected %s\n", debugstr_w(str), debugstr_w(test[i].X500_CN));
1202
1203 str[0] = 0;
1205 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1206 ok(!wcsncmp(str, L"2.5.4.3=", 8), "got %s\n", debugstr_w(str));
1207 ok(!wcscmp(&str[8], test[i].X500_CN), "got %s, expected %s\n", debugstr_w(&str[8]), debugstr_w(test[i].X500_CN));
1208
1209 str[0] = 0;
1211 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1212 ok(!wcsncmp(str, L"CN=", 3), "got %s\n", debugstr_w(str));
1213 ok(!wcscmp(&str[3], test[i].X500_CN), "got %s, expected %s\n", debugstr_w(&str[3]), debugstr_w(test[i].X500_CN));
1214
1215 str[0] = 0;
1217 ok(ret, "CertNameToStr error %08lx\n", GetLastError());
1218 ok(!wcsncmp(str, L"CN=", 3), "got %s\n", debugstr_w(str));
1219 ok(!wcscmp(&str[3], test[i].CN), "got %s, expected %s\n", debugstr_w(&str[3]), debugstr_w(test[i].CN));
1220
1221 LocalFree(buf);
1222
1224 }
1225}
#define CN(I, J, K)
BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, void *pvEncoded, DWORD *pcbEncoded)
Definition: encode.c:4696
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define debugstr_w
Definition: kernel32.h:32
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
#define test
Definition: rosglue.h:37
DWORD cRDNAttr
Definition: wincrypt.h:271
PCERT_RDN_ATTR rgRDNAttr
Definition: wincrypt.h:272
Definition: cookie.c:202
#define X509_UNICODE_NAME
Definition: wincrypt.h:3537
#define CRYPT_ENCODE_ALLOC_FLAG
Definition: wincrypt.h:3599
#define CERT_RDN_UNICODE_STRING
Definition: wincrypt.h:2939
char * LPSTR
Definition: xmlstorage.h:182

Referenced by START_TEST().

Variable Documentation

◆ bin1

BYTE bin1[] = { 0x55, 0x53 }
static

Definition at line 44 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin10

BYTE bin10[] = { 0x61, 0x62, 0x63, 0x27, 0x64, 0x65, 0x66 }
static

Definition at line 64 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin11

BYTE bin11[] = { 0x61, 0x62, 0x63, 0x2c, 0x20, 0x64, 0x65, 0x66 }
static

Definition at line 65 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin12

BYTE bin12[] = { 0x20, 0x61, 0x62, 0x63, 0x20 }
static

Definition at line 66 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin13

BYTE bin13[] = { 0x22, 0x64, 0x65, 0x66, 0x22 }
static

Definition at line 67 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin14

BYTE bin14[] = { 0x31, 0x3b, 0x33 }
static

Definition at line 68 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin2

BYTE bin2[]
static
Initial value:
= { 0x4d, 0x69, 0x6e, 0x6e, 0x65, 0x73, 0x6f, 0x74,
0x61 }

Definition at line 45 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin3

BYTE bin3[]
static
Initial value:
= { 0x4d, 0x69, 0x6e, 0x6e, 0x65, 0x61, 0x70, 0x6f,
0x6c, 0x69, 0x73 }

Definition at line 47 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin4

BYTE bin4[]
static
Initial value:
= { 0x43, 0x6f, 0x64, 0x65, 0x57, 0x65, 0x61, 0x76,
0x65, 0x72, 0x73 }

Definition at line 49 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin5

BYTE bin5[]
static
Initial value:
= { 0x57, 0x69, 0x6e, 0x65, 0x20, 0x44, 0x65, 0x76,
0x65, 0x6c, 0x6f, 0x70, 0x6d, 0x65, 0x6e, 0x74 }

Definition at line 51 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin6

BYTE bin6[]
static
Initial value:
= { 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
0x74 }

Definition at line 53 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin7

BYTE bin7[]
static
Initial value:
= { 0x61, 0x72, 0x69, 0x63, 0x40, 0x63, 0x6f, 0x64,
0x65, 0x77, 0x65, 0x61, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x6f, 0x6d }

Definition at line 55 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin8

BYTE bin8[]
static
Initial value:
= {
0x65,0x00,0x50,0x00,0x4b,0x00,0x49,0x00,0x20,0x00,0x52,0x00,0x6f,0x00,0x6f,
0x00,0x74,0x00,0x20,0x00,0x43,0x00,0x65,0x00,0x72,0x00,0x74,0x00,0x69,0x00,
0x66,0x00,0x69,0x00,0x63,0x00,0x61,0x00,0x74,0x00,0x69,0x00,0x6f,0x00,0x6e,
0x00,0x20,0x00,0x41,0x00,0x75,0x00,0x74,0x00,0x68,0x00,0x6f,0x00,0x72,0x00,
0x69,0x00,0x74,0x00,0x79,0x00 }

Definition at line 57 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ bin9

BYTE bin9[] = { 0x61, 0x62, 0x63, 0x22, 0x64, 0x65, 0x66 }
static

Definition at line 63 of file str.c.

Referenced by test_CertRDNValueToStrA(), and test_CertRDNValueToStrW().

◆ cert

const BYTE cert[]
static

Definition at line 91 of file str.c.

◆ cert_no_email

const BYTE cert_no_email[]
static

Definition at line 159 of file str.c.

Referenced by test_CertGetNameString().

◆ cert_v3

BYTE cert_v3[]
static

Definition at line 228 of file str.c.

Referenced by test_CertGetNameString().

◆ encodedCommaCN

BYTE encodedCommaCN[]
static
Initial value:
= {
0x30,0x0e,0x31,0x0c,0x30,0x0a,0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x61,0x2c,
0x62 }

Definition at line 495 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedDummyCN

BYTE encodedDummyCN[]
static
Initial value:
= {
0x30,0x1F,0x31,0x0E,0x30,0x0C,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x64,0x75,
0x6D,0x6D,0x79,0x31,0x0D,0x30,0x0B,0x06,0x03,0x55,0x04,0x0C,0x13,0x04,0x74,
0x65,0x73,0x74 }

Definition at line 516 of file str.c.

◆ encodedEqualCN

BYTE encodedEqualCN[]
static
Initial value:
= {
0x30,0x0e,0x31,0x0c,0x30,0x0a,0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x61,0x3d,
0x62 }

Definition at line 498 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedFields

BYTE encodedFields[]
static
Initial value:
= {
0x30,0x2F,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x03,0x13,0x09,0x57,0x69,
0x6E,0x65,0x20,0x54,0x65,0x73,0x74,0x31,0x0C,0x30,0x0A,0x06,0x03,0x55,0x04,
0x0C,0x13,0x03,0x31,0x32,0x33,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,
0x13,0x02,0x42,0x52 }

Definition at line 520 of file str.c.

◆ encodedGreaterThanCN

BYTE encodedGreaterThanCN[]
static
Initial value:
= {
0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x03,0x1e,0x02,0x00,0x3e
}

Definition at line 504 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedHashCN

BYTE encodedHashCN[]
static
Initial value:
= {
0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x03,0x1e,0x02,0x00,0x23
}

Definition at line 507 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedJapaneseCN

const BYTE encodedJapaneseCN[]
static
Initial value:
= { 0x30,0x0f,0x31,0x0d,0x30,0x0b,0x06,
0x03,0x55,0x04,0x03,0x1e,0x04,0x22,0x6f,0x57,0x5b }

Definition at line 861 of file str.c.

◆ encodedLessThanCN

BYTE encodedLessThanCN[]
static
Initial value:
= {
0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x03,0x1e,0x02,0x00,0x3c
}

Definition at line 501 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedMultipleAttrCN

BYTE encodedMultipleAttrCN[]
static
Initial value:
= { 0x30,0x0e,0x31,0x0c,0x30,0x0a,
0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x31,0x2b,0x32 }

Definition at line 493 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedNewlineCN

BYTE encodedNewlineCN[]
static
Initial value:
= {
0x30,0x11,0x31,0x0f,0x30,0x0d,0x06,0x03,0x55,0x04,0x03,0x1e,0x06,0x00,0x61,
0x00,0x0a,0x00,0x62 }

Definition at line 513 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedQuotedCN

BYTE encodedQuotedCN[]
static
Initial value:
= { 0x30,0x11,0x31,0x0f,0x30,0x0d,0x06,0x03,
0x55, 0x04,0x03,0x1e,0x06,0x00,0x22,0x00,0x31,0x00,0x22, }

Definition at line 491 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedSemiCN

BYTE encodedSemiCN[]
static
Initial value:
= {
0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x03,0x1e,0x02,0x00,0x3b
}

Definition at line 510 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedSimpleCN

BYTE encodedSimpleCN[]
static
Initial value:
= {
0x30,0x0c,0x31,0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x31 }

Definition at line 485 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedSingleQuotedCN

BYTE encodedSingleQuotedCN[]
static
Initial value:
= { 0x30,0x0e,0x31,0x0c,0x30,0x0a,
0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x27,0x31,0x27 }

Definition at line 487 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ encodedSpacedCN

BYTE encodedSpacedCN[]
static
Initial value:
= { 0x30,0x0e,0x31,0x0c,0x30,0x0a,0x06,0x03,
0x55,0x04,0x03,0x13,0x03,0x20,0x31,0x20 }

Definition at line 489 of file str.c.

Referenced by test_CertNameToStrA(), and test_CertNameToStrW().

◆ issuerStr

char issuerStr[]
static
Initial value:
=
"US, Minnesota, Minneapolis, CodeWeavers, Wine Development, localhost, aric@codeweavers.com"

Definition at line 299 of file str.c.

Referenced by test_CertGetNameString(), and test_CertNameToStrA().

◆ issuerStrCRLF

char issuerStrCRLF[]
static
Initial value:
=
"US\r\nMinnesota\r\nMinneapolis\r\nCodeWeavers\r\nWine Development\r\nlocalhost\r\naric@codeweavers.com"

Definition at line 303 of file str.c.

Referenced by test_CertNameToStrA().

◆ issuerStrSemicolon

char issuerStrSemicolon[]
static
Initial value:
=
"US; Minnesota; Minneapolis; CodeWeavers; Wine Development; localhost; aric@codeweavers.com"

Definition at line 301 of file str.c.

Referenced by test_CertNameToStrA().

◆ namesA

const struct StrToNameA namesA[]
static
Initial value:
= {
{ "CN=1", sizeof(encodedSimpleCN), encodedSimpleCN },
{ "CN=\"1\"", sizeof(encodedSimpleCN), encodedSimpleCN },
{ "CN = \"1\"", sizeof(encodedSimpleCN), encodedSimpleCN },
{ "CN=\" 1 \"", sizeof(encodedSpacedCN), encodedSpacedCN },
{ "CN=\"\"\"1\"\"\"", sizeof(encodedQuotedCN), encodedQuotedCN },
{ "CN=\"1+2\"", sizeof(encodedMultipleAttrCN), encodedMultipleAttrCN },
{ "CN=\"a,b\"", sizeof(encodedCommaCN), encodedCommaCN },
{ "CN=\"a=b\"", sizeof(encodedEqualCN), encodedEqualCN },
{ "CN=\"<\"", sizeof(encodedLessThanCN), encodedLessThanCN },
{ "CN=\">\"", sizeof(encodedGreaterThanCN), encodedGreaterThanCN },
{ "CN=\"#\"", sizeof(encodedHashCN), encodedHashCN },
{ "CN=\";\"", sizeof(encodedSemiCN), encodedSemiCN },
{ "CN=dummy,T=test", sizeof(encodedDummyCN), encodedDummyCN },
{ " CN = Wine Test,T = 123, C = BR", sizeof(encodedFields), encodedFields },
}
static BYTE encodedDummyCN[]
Definition: str.c:516
static BYTE encodedFields[]
Definition: str.c:520

Definition at line 762 of file str.c.

Referenced by test_CertStrToNameA().

◆ namesW

const struct StrToNameW namesW[]
static
Initial value:
= {
{ L"CN=1", sizeof(encodedSimpleCN), encodedSimpleCN },
{ L"CN=\"1\"", sizeof(encodedSimpleCN), encodedSimpleCN },
{ L"CN = \"1\"", sizeof(encodedSimpleCN), encodedSimpleCN },
{ L"CN=\" 1 \"", sizeof(encodedSpacedCN), encodedSpacedCN },
{ L"CN=\"\"\"1\"\"\"", sizeof(encodedQuotedCN), encodedQuotedCN },
{ L"CN=\"1+2\"", sizeof(encodedMultipleAttrCN), encodedMultipleAttrCN },
{ L"CN=\x226f\x575b", sizeof(encodedJapaneseCN), encodedJapaneseCN },
{ L"CN=\"a,b\"", sizeof(encodedCommaCN), encodedCommaCN },
{ L"CN=\"a=b\"", sizeof(encodedEqualCN), encodedEqualCN },
{ L"CN=\"<\"", sizeof(encodedLessThanCN), encodedLessThanCN },
{ L"CN=\">\"", sizeof(encodedGreaterThanCN), encodedGreaterThanCN },
{ L"CN=\"#\"", sizeof(encodedHashCN), encodedHashCN },
{ L"CN=\";\"", sizeof(encodedSemiCN), encodedSemiCN },
{ L"CN=dummy,T=test", sizeof(encodedDummyCN), encodedDummyCN },
{ L" CN = Wine Test,T = 123, C = BR", sizeof(encodedFields), encodedFields },
}
static const BYTE encodedJapaneseCN[]
Definition: str.c:861

Definition at line 864 of file str.c.

Referenced by test_CertStrToNameW(), and test_StdRegProv().

◆ subjectStr

char subjectStr[]
static
Initial value:
=
"2.5.4.6=US, 2.5.4.8=Minnesota, 2.5.4.7=Minneapolis, 2.5.4.10=CodeWeavers, 2.5.4.11=Wine Development, 2.5.4.3=localhost, 1.2.840.113549.1.9.1=aric@codeweavers.com"

Definition at line 305 of file str.c.

Referenced by test_CertGetNameString(), and test_CertNameToStrA().

◆ subjectStrCRLF

char subjectStrCRLF[]
static
Initial value:
=
"2.5.4.6=US\r\n2.5.4.8=Minnesota\r\n2.5.4.7=Minneapolis\r\n2.5.4.10=CodeWeavers\r\n2.5.4.11=Wine Development\r\n2.5.4.3=localhost\r\n1.2.840.113549.1.9.1=aric@codeweavers.com"

Definition at line 309 of file str.c.

Referenced by test_CertNameToStrA().

◆ subjectStrSemicolon

char subjectStrSemicolon[]
static
Initial value:
=
"2.5.4.6=US; 2.5.4.8=Minnesota; 2.5.4.7=Minneapolis; 2.5.4.10=CodeWeavers; 2.5.4.11=Wine Development; 2.5.4.3=localhost; 1.2.840.113549.1.9.1=aric@codeweavers.com"

Definition at line 307 of file str.c.

Referenced by test_CertNameToStrA().

◆ x500SubjectStr

char x500SubjectStr[] = "C=US, S=Minnesota, L=Minneapolis, O=CodeWeavers, OU=Wine Development, CN=localhost, E=aric@codeweavers.com"
static

Definition at line 311 of file str.c.

Referenced by test_CertNameToStrA().

◆ x500SubjectStrSemicolonReverse

char x500SubjectStrSemicolonReverse[] = "E=aric@codeweavers.com; CN=localhost; OU=Wine Development; O=CodeWeavers; L=Minneapolis; S=Minnesota; C=US"
static

Definition at line 312 of file str.c.

Referenced by test_CertNameToStrA().