crypt32/tests: Demonstrate that CryptStringToBinary can take arbitrary key headers and trailers.

This commit is contained in:
Andrew Bogott 2011-04-23 10:18:40 -05:00 committed by Alexandre Julliard
parent a5cfae6db3
commit 812d647705
1 changed files with 5 additions and 0 deletions

View File

@ -28,7 +28,9 @@
#include "wine/test.h"
#define CERT_HEADER "-----BEGIN CERTIFICATE-----\r\n"
#define ALT_CERT_HEADER "-----BEGIN This is some arbitrary text that goes on and on-----\r\n"
#define CERT_TRAILER "-----END CERTIFICATE-----\r\n"
#define ALT_CERT_TRAILER "-----END More arbitrary text------\r\n"
#define CERT_REQUEST_HEADER "-----BEGIN NEW CERTIFICATE REQUEST-----\r\n"
#define CERT_REQUEST_TRAILER "-----END NEW CERTIFICATE REQUEST-----\r\n"
#define X509_HEADER "-----BEGIN X509 CRL-----\r\n"
@ -360,6 +362,9 @@ static void testStringToBinaryA(void)
decodeAndCompareBase64_A(tests[i].base64, CERT_HEADER, CERT_TRAILER,
CRYPT_STRING_BASE64HEADER, CRYPT_STRING_BASE64HEADER,
tests[i].toEncode, tests[i].toEncodeLen);
decodeAndCompareBase64_A(tests[i].base64, ALT_CERT_HEADER, ALT_CERT_TRAILER,
CRYPT_STRING_BASE64HEADER, CRYPT_STRING_BASE64HEADER,
tests[i].toEncode, tests[i].toEncodeLen);
decodeAndCompareBase64_A(tests[i].base64, CERT_REQUEST_HEADER,
CERT_REQUEST_TRAILER, CRYPT_STRING_BASE64REQUESTHEADER,
CRYPT_STRING_BASE64REQUESTHEADER, tests[i].toEncode,