Commit 812d6477 authored by Andrew Bogott's avatar Andrew Bogott Committed by Alexandre Julliard

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

parent a5cfae6d
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
#include "wine/test.h" #include "wine/test.h"
#define CERT_HEADER "-----BEGIN CERTIFICATE-----\r\n" #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 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_HEADER "-----BEGIN NEW CERTIFICATE REQUEST-----\r\n"
#define CERT_REQUEST_TRAILER "-----END NEW CERTIFICATE REQUEST-----\r\n" #define CERT_REQUEST_TRAILER "-----END NEW CERTIFICATE REQUEST-----\r\n"
#define X509_HEADER "-----BEGIN X509 CRL-----\r\n" #define X509_HEADER "-----BEGIN X509 CRL-----\r\n"
...@@ -360,6 +362,9 @@ static void testStringToBinaryA(void) ...@@ -360,6 +362,9 @@ static void testStringToBinaryA(void)
decodeAndCompareBase64_A(tests[i].base64, CERT_HEADER, CERT_TRAILER, decodeAndCompareBase64_A(tests[i].base64, CERT_HEADER, CERT_TRAILER,
CRYPT_STRING_BASE64HEADER, CRYPT_STRING_BASE64HEADER, CRYPT_STRING_BASE64HEADER, CRYPT_STRING_BASE64HEADER,
tests[i].toEncode, tests[i].toEncodeLen); 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, decodeAndCompareBase64_A(tests[i].base64, CERT_REQUEST_HEADER,
CERT_REQUEST_TRAILER, CRYPT_STRING_BASE64REQUESTHEADER, CERT_REQUEST_TRAILER, CRYPT_STRING_BASE64REQUESTHEADER,
CRYPT_STRING_BASE64REQUESTHEADER, tests[i].toEncode, CRYPT_STRING_BASE64REQUESTHEADER, tests[i].toEncode,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment