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

Go to the source code of this file.

Functions

static void test_msg_get_signer_count (void)
 
static void test_verify_detached_message_hash (void)
 
static void test_verify_message_hash (void)
 
static PCCERT_CONTEXT WINAPI msg_get_signer_callback (void *pvArg, DWORD certEncodingType, PCERT_INFO signerId, HCERTSTORE store)
 
static void test_verify_detached_message_signature (void)
 
static void test_verify_message_signature (void)
 
static void test_hash_message (void)
 
static void test_sign_message (void)
 
static void test_encrypt_message (void)
 
 START_TEST (message)
 

Variables

static const BYTE dataEmptyBareContent [] = { 0x04,0x00 }
 
static const BYTE dataEmptyContent []
 
static const BYTE signedEmptyBareContent []
 
static const BYTE signedEmptyContent []
 
static BYTE detachedHashContent []
 
static const BYTE msgData [] = { 1, 2, 3, 4 }
 
static BYTE hashContent []
 
static const BYTE signedWithCertContent []
 
static const BYTE signedContent []
 
static const BYTE detachedSignedContent []
 
static const BYTE v1CertWithValidPubKey []
 
static const BYTE signedWithCertEmptyContent []
 
static const BYTE signedWithCertWithPubKeyContent []
 
static const BYTE signedWithCertWithValidPubKeyContent []
 
static const BYTE detachedHashBlob []
 
static const BYTE hashBlob []
 
static const BYTE hashVal []
 
static const BYTE publicPrivateKeyPair []
 
static const BYTE cert1 []
 
static const BYTE cert2 []
 
static const BYTE crl []
 
static const BYTE signedHashForEmptyMessage []
 
static const BYTE signedEmptyMessage []
 
static const BYTE signedHash []
 
static const BYTE signedHashWithCert []
 
static const BYTE signedHashWithCRL []
 
static const BYTE signedData []
 
static const BYTE encryptedMessage []
 

Function Documentation

◆ msg_get_signer_callback()

static PCCERT_CONTEXT WINAPI msg_get_signer_callback ( void pvArg,
DWORD  certEncodingType,
PCERT_INFO  signerId,
HCERTSTORE  store 
)
static

Definition at line 312 of file message.c.

314{
317}
PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
Definition: cert.c:316
static const BYTE v1CertWithValidPubKey[]
Definition: message.c:296
#define X509_ASN_ENCODING
Definition: wincrypt.h:2501

Referenced by test_verify_detached_message_signature().

◆ START_TEST()

START_TEST ( message  )

Definition at line 1302 of file message.c.

1303{
1312}
static void test_verify_detached_message_hash(void)
Definition: message.c:95
static void test_encrypt_message(void)
Definition: message.c:1156
static void test_verify_message_hash(void)
Definition: message.c:191
static void test_msg_get_signer_count(void)
Definition: message.c:50
static void test_verify_message_signature(void)
Definition: message.c:467
static void test_sign_message(void)
Definition: message.c:947
static void test_hash_message(void)
Definition: message.c:607
static void test_verify_detached_message_signature(void)
Definition: message.c:319

◆ test_encrypt_message()

static void test_encrypt_message ( void  )
static

Definition at line 1156 of file message.c.

1157{
1158 BOOL ret;
1160 static char oid_rsa_rc4[] = szOID_RSA_RC4;
1161 static const BYTE blob[] = { 0x01, 0x02, 0x03, 0x04 };
1162 PCCERT_CONTEXT certs[2];
1163 HCRYPTPROV hCryptProv = 0;
1164 LPBYTE encryptedBlob;
1165 DWORD encryptedBlobSize;
1166
1167 SetLastError(0xdeadbeef);
1170 ok(ret, "CryptAcquireContextA failed: %08lx\n", GetLastError());
1171
1172 SetLastError(0xdeadbeef);
1174 PKCS_7_ASN_ENCODING, cert1, sizeof(cert1));
1175 ok(certs[0] != NULL, "CertCreateCertificateContext failed: %08lx\n",
1176 GetLastError());
1177 SetLastError(0xdeadbeef);
1179 PKCS_7_ASN_ENCODING, cert2, sizeof(cert2));
1180 ok(certs[1] != NULL, "CertCreateCertificateContext failed: %08lx\n",
1181 GetLastError());
1182
1183 memset(&para, 0, sizeof(para));
1184 SetLastError(0xdeadbeef);
1185 encryptedBlobSize = 255;
1186 ret = CryptEncryptMessage(&para, 0, NULL, NULL, 0, NULL,
1187 &encryptedBlobSize);
1189 "expected E_INVALIDARG, got %08lx\n", GetLastError());
1190 ok(!encryptedBlobSize, "unexpected size %ld\n", encryptedBlobSize);
1191 para.cbSize = sizeof(para);
1193 SetLastError(0xdeadbeef);
1194 encryptedBlobSize = 255;
1195 ret = CryptEncryptMessage(&para, 0, NULL, NULL, 0, NULL,
1196 &encryptedBlobSize);
1198 "expected E_INVALIDARG, got %08lx\n", GetLastError());
1199 ok(!encryptedBlobSize, "unexpected size %ld\n", encryptedBlobSize);
1201 SetLastError(0xdeadbeef);
1202 encryptedBlobSize = 255;
1203 ret = CryptEncryptMessage(&para, 0, NULL, NULL, 0, NULL,
1204 &encryptedBlobSize);
1206 "expected CRYPT_E_UNKNOWN_ALGO or E_INVALIDARG, got %08lx\n",
1207 GetLastError());
1208 ok(!encryptedBlobSize, "unexpected size %ld\n", encryptedBlobSize);
1209
1210 para.hCryptProv = hCryptProv;
1212
1213 SetLastError(0xdeadbeef);
1214 encryptedBlobSize = 0;
1215 ret = CryptEncryptMessage(&para, 0, NULL, NULL, 0, NULL,
1216 &encryptedBlobSize);
1217 ok(ret, "CryptEncryptMessage failed: %08lx\n", GetLastError());
1218 if (ret)
1219 {
1220 encryptedBlob = CryptMemAlloc(encryptedBlobSize);
1221 if (encryptedBlob)
1222 {
1223 SetLastError(0xdeadbeef);
1224 ret = CryptEncryptMessage(&para, 0, NULL, NULL, 0, encryptedBlob,
1225 &encryptedBlobSize);
1226 ok(ret, "CryptEncryptMessage failed: %08lx\n", GetLastError());
1227 ok(encryptedBlobSize == sizeof(encryptedMessage),
1228 "unexpected size of encrypted blob %ld\n", encryptedBlobSize);
1229 ok(!memcmp(encryptedBlob, encryptedMessage, encryptedBlobSize),
1230 "unexpected value\n");
1231 CryptMemFree(encryptedBlob);
1232 }
1233 }
1234
1235 SetLastError(0xdeadbeef);
1236 encryptedBlobSize = 0;
1237 ret = CryptEncryptMessage(&para, 2, certs, NULL, 0, NULL,
1238 &encryptedBlobSize);
1239 ok(ret, "CryptEncryptMessage failed: %08lx\n", GetLastError());
1240 if (ret)
1241 {
1242 encryptedBlob = CryptMemAlloc(encryptedBlobSize);
1243 if (encryptedBlob)
1244 {
1245 SetLastError(0xdeadbeef);
1246 ret = CryptEncryptMessage(&para, 2, certs, NULL, 0, encryptedBlob,
1247 &encryptedBlobSize);
1248 ok(ret, "CryptEncryptMessage failed: %08lx\n", GetLastError());
1249 CryptMemFree(encryptedBlob);
1250 }
1251 }
1252
1253 SetLastError(0xdeadbeef);
1254 encryptedBlobSize = 0;
1255 ret = CryptEncryptMessage(&para, 0, NULL, blob, sizeof(blob), NULL,
1256 &encryptedBlobSize);
1257 ok(ret, "CryptEncryptMessage failed: %08lx\n", GetLastError());
1258 if (ret)
1259 {
1260 encryptedBlob = CryptMemAlloc(encryptedBlobSize);
1261 if (encryptedBlob)
1262 {
1263 SetLastError(0xdeadbeef);
1264 ret = CryptEncryptMessage(&para, 0, NULL, blob, sizeof(blob),
1265 encryptedBlob, &encryptedBlobSize);
1266 ok(ret, "CryptEncryptMessage failed: %08lx\n", GetLastError());
1267 if (ret)
1268 {
1269 ok(encryptedBlobSize == 55,
1270 "unexpected size of encrypted blob %ld\n", encryptedBlobSize);
1271 }
1272 CryptMemFree(encryptedBlob);
1273 }
1274 }
1275
1276 SetLastError(0xdeadbeef);
1277 encryptedBlobSize = 0;
1278 ret = CryptEncryptMessage(&para, 2, certs, blob, sizeof(blob), NULL,
1279 &encryptedBlobSize);
1280 ok(ret, "CryptEncryptMessage failed: %08lx\n", GetLastError());
1281 if (ret)
1282 {
1283 encryptedBlob = CryptMemAlloc(encryptedBlobSize);
1284 if (encryptedBlob)
1285 {
1286 SetLastError(0xdeadbeef);
1287 ret = CryptEncryptMessage(&para, 2, certs, blob, sizeof(blob),
1288 encryptedBlob, &encryptedBlobSize);
1289 ok(ret, "CryptEncryptMessage failed: %08lx\n", GetLastError());
1290 CryptMemFree(encryptedBlob);
1291 }
1292 }
1293
1294 if (certs[0])
1296 if (certs[1])
1298 if (hCryptProv)
1299 CryptReleaseContext(hCryptProv, 0);
1300}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ok(value,...)
Definition: atltest.h:57
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
Definition: crypt.c:648
BOOL WINAPI CryptAcquireContextA(HCRYPTPROV *phProv, LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags)
Definition: crypt.c:569
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:371
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141
BOOL WINAPI CryptEncryptMessage(PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara, DWORD cRecipientCert, PCCERT_CONTEXT rgpRecipientCert[], const BYTE *pbToBeEncrypted, DWORD cbToBeEncrypted, BYTE *pbEncryptedBlob, DWORD *pcbEncryptedBlob)
Definition: message.c:521
#define SetLastError(x)
Definition: compat.h:752
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
static const BYTE cert2[]
Definition: message.c:797
static const BYTE cert1[]
Definition: message.c:781
static const BYTE encryptedMessage[]
Definition: message.c:1150
static char oid_rsa_rc4[]
Definition: msg.c:1995
#define memset(x, y, z)
Definition: compat.h:39
HCRYPTPROV_LEGACY hCryptProv
Definition: wincrypt.h:1694
CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm
Definition: wincrypt.h:1695
Definition: image.c:134
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define PROV_RSA_FULL
Definition: wincrypt.h:2243
#define CRYPT_VERIFYCONTEXT
Definition: wincrypt.h:2273
ULONG_PTR HCRYPTPROV
Definition: wincrypt.h:55
#define szOID_RSA_RC4
Definition: wincrypt.h:3208
#define PKCS_7_ASN_ENCODING
Definition: wincrypt.h:2503
#define CRYPT_E_UNKNOWN_ALGO
Definition: winerror.h:4400
unsigned char BYTE
Definition: xxhash.c:193

Referenced by START_TEST().

◆ test_hash_message()

static void test_hash_message ( void  )
static

Definition at line 607 of file message.c.

608{
609 BOOL ret;
611 static const BYTE blob1[] = { 0xde, 0xad, 0xbe, 0xef };
612 static const BYTE blob2[] = { 0xba, 0xad, 0xf0, 0x0d };
613 const BYTE *toHash[] = { blob1, blob2 };
614 DWORD hashSize[] = { sizeof(blob1), sizeof(blob2) };
615 DWORD hashedBlobSize, computedHashSize;
616 static char oid_rsa_md5[] = szOID_RSA_MD5;
617 LPBYTE hashedBlob, computedHash;
618
619 /* Crash
620 ret = CryptHashMessage(NULL, FALSE, 0, NULL, 0, NULL, NULL, NULL, NULL);
621 */
622 memset(&para, 0, sizeof(para));
623 SetLastError(0xdeadbeef);
624 ret = CryptHashMessage(&para, FALSE, 0, NULL, NULL, NULL, NULL, NULL, NULL);
626 "expected E_INVALIDARG, got 0x%08lx\n", GetLastError());
627 para.cbSize = sizeof(para);
628 /* Not quite sure what "success" means in this case, but it does succeed */
629 SetLastError(0xdeadbeef);
630 ret = CryptHashMessage(&para, FALSE, 0, NULL, NULL, NULL, NULL, NULL, NULL);
631 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
632 /* With a bogus encoding type it "succeeds" */
633 para.dwMsgEncodingType = 0xdeadbeef;
634 SetLastError(0xdeadbeef);
635 ret = CryptHashMessage(&para, FALSE, 0, NULL, NULL, NULL, NULL, NULL, NULL);
636 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
637 /* According to MSDN, the third parameter (cToBeHashed) must be 1 if the
638 * second parameter (fDetached) is FALSE, but again it "succeeds."
639 */
640 SetLastError(0xdeadbeef);
641 ret = CryptHashMessage(&para, FALSE, 2, NULL, NULL, NULL, NULL, NULL, NULL);
642 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
643 /* Even passing parameters to hash results in "success." */
644 SetLastError(0xdeadbeef);
645 ret = CryptHashMessage(&para, FALSE, 2, toHash, hashSize, NULL, NULL, NULL,
646 NULL);
647 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
648 /* Try again with a valid encoding type */
650 SetLastError(0xdeadbeef);
651 ret = CryptHashMessage(&para, FALSE, 2, NULL, NULL, NULL, NULL, NULL, NULL);
652 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
653 /* And with valid data to hash */
654 SetLastError(0xdeadbeef);
655 ret = CryptHashMessage(&para, FALSE, 2, toHash, hashSize, NULL, NULL, NULL,
656 NULL);
657 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
658 /* But requesting the size of the hashed blob and indicating there's data
659 * to hash results in a crash
660 */
661 if (0)
662 {
663 CryptHashMessage(&para, FALSE, 2, NULL, NULL, NULL,
664 &hashedBlobSize, NULL, NULL);
665 }
666 /* Passing a valid pointer for the data to hash fails, as the hash
667 * algorithm is finally checked.
668 */
669 SetLastError(0xdeadbeef);
670 ret = CryptHashMessage(&para, FALSE, 2, toHash, hashSize, NULL,
671 &hashedBlobSize, NULL, NULL);
672 ok(!ret &&
674 GetLastError() == CRYPT_E_OID_FORMAT), /* Vista */
675 "expected CRYPT_E_UNKNOWN_ALGO or CRYPT_E_OID_FORMAT, got 0x%08lx (%ld)\n",
678 /* With a valid hash algorithm, this succeeds, even though fDetached is
679 * FALSE.
680 */
681 SetLastError(0xdeadbeef);
682 ret = CryptHashMessage(&para, FALSE, 2, toHash, hashSize, NULL,
683 &hashedBlobSize, NULL, NULL);
685 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
686 if (ret)
687 {
688 /* Actually attempting to get the hashed data fails, perhaps because
689 * detached is FALSE.
690 */
691 hashedBlob = malloc(hashedBlobSize);
692 SetLastError(0xdeadbeef);
693 ret = CryptHashMessage(&para, FALSE, 2, toHash, hashSize, hashedBlob,
694 &hashedBlobSize, NULL, NULL);
696 "expected CRYPT_E_MSG_ERROR, got 0x%08lx (%ld)\n", GetLastError(),
697 GetLastError());
698 free(hashedBlob);
699 }
700 /* Repeating tests with fDetached = TRUE results in success */
701 SetLastError(0xdeadbeef);
702 ret = CryptHashMessage(&para, TRUE, 2, toHash, hashSize, NULL,
703 &hashedBlobSize, NULL, NULL);
704 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
705 if (ret)
706 {
707 hashedBlob = malloc(hashedBlobSize);
708 SetLastError(0xdeadbeef);
709 ret = CryptHashMessage(&para, TRUE, 2, toHash, hashSize, hashedBlob,
710 &hashedBlobSize, NULL, NULL);
711 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
712 ok(hashedBlobSize == sizeof(detachedHashBlob),
713 "unexpected size of detached blob %ld\n", hashedBlobSize);
714 ok(!memcmp(hashedBlob, detachedHashBlob, hashedBlobSize),
715 "unexpected detached blob value\n");
716 free(hashedBlob);
717 }
718 /* Hashing a single item with fDetached = FALSE also succeeds */
719 SetLastError(0xdeadbeef);
720 ret = CryptHashMessage(&para, FALSE, 1, toHash, hashSize, NULL,
721 &hashedBlobSize, NULL, NULL);
722 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
723 if (ret)
724 {
725 hashedBlob = malloc(hashedBlobSize);
726 ret = CryptHashMessage(&para, FALSE, 1, toHash, hashSize, hashedBlob,
727 &hashedBlobSize, NULL, NULL);
728 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
729 ok(hashedBlobSize == sizeof(hashBlob),
730 "unexpected size of detached blob %ld\n", hashedBlobSize);
731 ok(!memcmp(hashedBlob, hashBlob, hashedBlobSize),
732 "unexpected detached blob value\n");
733 free(hashedBlob);
734 }
735 /* Check the computed hash value too. You don't need to get the encoded
736 * blob to get it.
737 */
738 computedHashSize = 0xdeadbeef;
739 ret = CryptHashMessage(&para, TRUE, 2, toHash, hashSize, NULL,
740 &hashedBlobSize, NULL, &computedHashSize);
741 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
742 ok(computedHashSize == 16, "expected hash size of 16, got %ld\n",
743 computedHashSize);
744 if (ret)
745 {
746 computedHash = malloc(computedHashSize);
747 SetLastError(0xdeadbeef);
748 ret = CryptHashMessage(&para, TRUE, 2, toHash, hashSize, NULL,
749 &hashedBlobSize, computedHash, &computedHashSize);
750 ok(ret, "CryptHashMessage failed: 0x%08lx\n", GetLastError());
751 ok(computedHashSize == sizeof(hashVal),
752 "unexpected size of hash value %ld\n", computedHashSize);
753 ok(!memcmp(computedHash, hashVal, computedHashSize),
754 "unexpected value\n");
755 free(computedHash);
756 }
757}
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI CryptHashMessage(PCRYPT_HASH_MESSAGE_PARA pHashPara, BOOL fDetachedHash, DWORD cToBeHashed, const BYTE *rgpbToBeHashed[], DWORD rgcbToBeHashed[], BYTE *pbHashedBlob, DWORD *pcbHashedBlob, BYTE *pbComputedHash, DWORD *pcbComputedHash)
Definition: message.c:255
#define todo_wine
Definition: minitest.h:80
static const BYTE hashBlob[]
Definition: message.c:597
static const BYTE detachedHashBlob[]
Definition: message.c:591
static const BYTE hashVal[]
Definition: message.c:603
static char oid_rsa_md5[]
Definition: msg.c:32
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm
Definition: wincrypt.h:1717
#define szOID_RSA_MD5
Definition: wincrypt.h:3206
#define CRYPT_E_MSG_ERROR
Definition: winerror.h:4399
#define CRYPT_E_OID_FORMAT
Definition: winerror.h:4401

Referenced by START_TEST().

◆ test_msg_get_signer_count()

static void test_msg_get_signer_count ( void  )
static

Definition at line 50 of file message.c.

51{
52 LONG count;
53
54 SetLastError(0xdeadbeef);
56 ok(count == -1, "Expected -1, got %ld\n", count);
57 ok(GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n",
58 GetLastError());
59 SetLastError(0xdeadbeef);
61 ok(count == -1, "Expected -1, got %ld\n", count);
63 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GetLastError());
64 SetLastError(0xdeadbeef);
67 ok(count == -1, "Expected -1, got %ld\n", count);
69 "Expected CRYPT_E_ASN1_BADTAG, got %08lx\n", GetLastError());
70 SetLastError(0xdeadbeef);
73 ok(count == -1, "Expected -1, got %ld\n", count);
75 "Expected CRYPT_E_INVALID_MSG_TYPE, got %08lx\n", GetLastError());
76 SetLastError(0xdeadbeef);
79 ok(count == -1, "Expected -1, got %ld\n", count);
81 "Expected CRYPT_E_ASN1_BADTAG, got %08lx\n", GetLastError());
84 ok(count == 1, "Expected 1, got %ld\n", count);
85}
LONG WINAPI CryptGetMessageSignerCount(DWORD dwMsgEncodingType, const BYTE *pbSignedBlob, DWORD cbSignedBlob)
Definition: message.c:41
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const BYTE dataEmptyContent[]
Definition: message.c:31
static const BYTE dataEmptyBareContent[]
Definition: message.c:30
static const BYTE signedEmptyBareContent[]
Definition: message.c:34
static const BYTE signedEmptyContent[]
Definition: message.c:41
long LONG
Definition: pedump.c:60
#define CRYPT_E_INVALID_MSG_TYPE
Definition: winerror.h:4402
#define CRYPT_E_ASN1_EOD
Definition: winerror.h:4501
#define CRYPT_E_ASN1_BADTAG
Definition: winerror.h:4510

Referenced by START_TEST().

◆ test_sign_message()

static void test_sign_message ( void  )
static

Definition at line 947 of file message.c.

948{
949 BOOL ret;
951 static char oid_rsa_md5[] = szOID_RSA_MD5;
952 static const BYTE blob1[] = { 0x01, 0x02, 0x03, 0x04 };
953 static const BYTE blob2[] = { 0x11, 0x12, 0x13, 0x14 };
954 const BYTE *toSign[] = { blob1, blob2 };
955 DWORD signSize[] = { sizeof(blob1), sizeof(blob2) };
956 LPBYTE signedBlob;
957 DWORD signedBlobSize;
958 PCCRL_CONTEXT crlContext;
959 CERT_KEY_CONTEXT keyContext;
960 HCRYPTPROV hCryptProv = 0;
961 HCRYPTKEY hKey = 0;
962
963 memset(&para, 0, sizeof(para));
964 SetLastError(0xdeadbeef);
965 ret = CryptSignMessage(&para, FALSE, 0, NULL, NULL, NULL, &signedBlobSize);
966 ok(!ret &&
969 "expected E_INVALIDARG or ERROR_ARITHMETIC_OVERFLOW, got %08lx\n",
970 GetLastError());
971 para.cbSize = sizeof(para);
973 SetLastError(0xdeadbeef);
974 signedBlobSize = 255;
975 ret = CryptSignMessage(&para, FALSE, 0, NULL, NULL, NULL, &signedBlobSize);
977 "expected E_INVALIDARG, got %08lx\n", GetLastError());
978 ok(!signedBlobSize, "unexpected size %ld\n", signedBlobSize);
980 SetLastError(0xdeadbeef);
981 signedBlobSize = 0;
982 ret = CryptSignMessage(&para, FALSE, 0, NULL, NULL, NULL, &signedBlobSize);
983 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
985 ok(signedBlobSize, "bad size\n");
986
987 SetLastError(0xdeadbeef);
990 ok(ret, "CryptAcquireContextA failed: %08lx\n", GetLastError());
991 SetLastError(0xdeadbeef);
993 sizeof(publicPrivateKeyPair), 0, 0, &hKey);
994 ok(ret, "CryptImportKey failed: %08lx\n", GetLastError());
995
997 SetLastError(0xdeadbeef);
1000 ok(para.pSigningCert != NULL, "CertCreateCertificateContext failed: %08lx\n",
1001 GetLastError());
1003
1004 memset(&keyContext, 0, sizeof(keyContext));
1005 keyContext.cbSize = sizeof(keyContext);
1006 keyContext.hCryptProv = hCryptProv;
1007 keyContext.dwKeySpec = AT_SIGNATURE;
1008 SetLastError(0xdeadbeef);
1010 CERT_KEY_CONTEXT_PROP_ID, 0, &keyContext);
1011 ok(ret, "CertSetCertificateContextProperty failed: %08lx\n", GetLastError());
1012
1013 SetLastError(0xdeadbeef);
1014 signedBlobSize = 0;
1015 ret = CryptSignMessage(&para, TRUE, 0, NULL, NULL, NULL, &signedBlobSize);
1016 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1017 signedBlob = CryptMemAlloc(signedBlobSize);
1018 if (signedBlob)
1019 {
1020 SetLastError(0xdeadbeef);
1021 ret = CryptSignMessage(&para, TRUE, 0, NULL, NULL, signedBlob,
1022 &signedBlobSize);
1023 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1024 ok(signedBlobSize == sizeof(signedHashForEmptyMessage),
1025 "unexpected size %ld\n", signedBlobSize);
1026 ok(!memcmp(signedBlob, signedHashForEmptyMessage, signedBlobSize),
1027 "unexpected value\n");
1028 CryptMemFree(signedBlob);
1029 }
1030
1031 SetLastError(0xdeadbeef);
1032 signedBlobSize = 0;
1033 ret = CryptSignMessage(&para, FALSE, 0, NULL, NULL, NULL, &signedBlobSize);
1034 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1035 signedBlob = CryptMemAlloc(signedBlobSize);
1036 if (signedBlob)
1037 {
1038 SetLastError(0xdeadbeef);
1039 ret = CryptSignMessage(&para, FALSE, 0, NULL, NULL, signedBlob,
1040 &signedBlobSize);
1041 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1042 ok(signedBlobSize == sizeof(signedEmptyMessage), "unexpected size %ld\n",
1043 signedBlobSize);
1044 ok(!memcmp(signedBlob, signedEmptyMessage, signedBlobSize),
1045 "unexpected value\n");
1046 CryptMemFree(signedBlob);
1047 }
1048
1049 SetLastError(0xdeadbeef);
1050 signedBlobSize = 0;
1051 ret = CryptSignMessage(&para, TRUE, 2, toSign, signSize, NULL,
1052 &signedBlobSize);
1053 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1054 signedBlob = CryptMemAlloc(signedBlobSize);
1055 if (signedBlob)
1056 {
1057 SetLastError(0xdeadbeef);
1058 ret = CryptSignMessage(&para, TRUE, 2, toSign, signSize, signedBlob,
1059 &signedBlobSize);
1060 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1061 ok(signedBlobSize == sizeof(signedHash),
1062 "unexpected size of signed blob %ld\n", signedBlobSize);
1063 ok(!memcmp(signedBlob, signedHash, signedBlobSize),
1064 "unexpected value\n");
1065 CryptMemFree(signedBlob);
1066 }
1067
1068 para.cMsgCert = 1;
1069 para.rgpMsgCert = &para.pSigningCert;
1070
1071 SetLastError(0xdeadbeef);
1072 signedBlobSize = 0;
1073 ret = CryptSignMessage(&para, TRUE, 2, toSign, signSize, NULL,
1074 &signedBlobSize);
1075 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1076 signedBlob = CryptMemAlloc(signedBlobSize);
1077 if (signedBlob)
1078 {
1079 SetLastError(0xdeadbeef);
1080 ret = CryptSignMessage(&para, TRUE, 2, toSign, signSize, signedBlob,
1081 &signedBlobSize);
1082 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1083 ok(signedBlobSize == sizeof(signedHashWithCert),
1084 "unexpected size of signed blob %ld\n", signedBlobSize);
1085 ok(!memcmp(signedBlob, signedHashWithCert, signedBlobSize),
1086 "unexpected value\n");
1087 CryptMemFree(signedBlob);
1088 }
1089
1090 para.cMsgCert = 0;
1091 para.rgpMsgCert = NULL;
1092 para.cMsgCrl = 1;
1093 SetLastError(0xdeadbeef);
1095 crl, sizeof(crl));
1096 ok(crlContext != NULL, "CertCreateCRLContext failed: %08lx\n",
1097 GetLastError());
1098 para.rgpMsgCrl = &crlContext;
1099
1100 SetLastError(0xdeadbeef);
1101 signedBlobSize = 0;
1102 ret = CryptSignMessage(&para, TRUE, 2, toSign, signSize, NULL,
1103 &signedBlobSize);
1104 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1105 signedBlob = CryptMemAlloc(signedBlobSize);
1106 if (signedBlob)
1107 {
1108 SetLastError(0xdeadbeef);
1109 ret = CryptSignMessage(&para, TRUE, 2, toSign, signSize, signedBlob,
1110 &signedBlobSize);
1111 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1112 ok(signedBlobSize == sizeof(signedHashWithCRL),
1113 "unexpected size of signed blob %ld\n", signedBlobSize);
1114 ok(!memcmp(signedBlob, signedHashWithCRL, signedBlobSize),
1115 "unexpected value\n");
1116 CryptMemFree(signedBlob);
1117 }
1118
1119 CertFreeCRLContext(crlContext);
1120 para.cMsgCrl = 0;
1121 para.rgpMsgCrl = NULL;
1122
1123 SetLastError(0xdeadbeef);
1124 signedBlobSize = 0;
1125 ret = CryptSignMessage(&para, FALSE, 1, toSign, signSize, NULL,
1126 &signedBlobSize);
1127 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1128 signedBlob = CryptMemAlloc(signedBlobSize);
1129 if (signedBlob)
1130 {
1131 SetLastError(0xdeadbeef);
1132 ret = CryptSignMessage(&para, FALSE, 1, toSign, signSize, signedBlob,
1133 &signedBlobSize);
1134 ok(ret, "CryptSignMessage failed: %08lx\n", GetLastError());
1135 ok(signedBlobSize == sizeof(signedData),
1136 "unexpected size of signed blob %ld\n", signedBlobSize);
1137 ok(!memcmp(signedBlob, signedData, signedBlobSize),
1138 "unexpected value\n");
1139 CryptMemFree(signedBlob);
1140 }
1141
1142 if (para.pSigningCert)
1144 if (hKey)
1146 if (hCryptProv)
1147 CryptReleaseContext(hCryptProv, 0);
1148}
BOOL WINAPI CryptDestroyKey(HCRYPTKEY hKey)
Definition: crypt.c:930
BOOL WINAPI CryptImportKey(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey)
Definition: crypt.c:1850
BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: cert.c:799
BOOL WINAPI CertFreeCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:386
PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded)
Definition: crl.c:85
BOOL WINAPI CryptSignMessage(PCRYPT_SIGN_MESSAGE_PARA pSignPara, BOOL fDetachedSignature, DWORD cToBeSigned, const BYTE *rgpbToBeSigned[], DWORD rgcbToBeSigned[], BYTE *pbSignedBlob, DWORD *pcbSignedBlob)
Definition: message.c:406
FxAutoRegKey hKey
static const BYTE signedEmptyMessage[]
Definition: message.c:846
static const BYTE publicPrivateKeyPair[]
Definition: message.c:759
static const BYTE signedData[]
Definition: message.c:931
static const BYTE signedHash[]
Definition: message.c:860
static const BYTE crl[]
Definition: message.c:817
static const BYTE signedHashForEmptyMessage[]
Definition: message.c:832
static const BYTE signedHashWithCRL[]
Definition: message.c:903
static const BYTE signedHashWithCert[]
Definition: message.c:874
HCRYPTPROV hCryptProv
Definition: wincrypt.h:229
PCCERT_CONTEXT * rgpMsgCert
Definition: wincrypt.h:1651
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm
Definition: wincrypt.h:1648
PCCERT_CONTEXT pSigningCert
Definition: wincrypt.h:1647
PCCRL_CONTEXT * rgpMsgCrl
Definition: wincrypt.h:1653
#define CERT_KEY_CONTEXT_PROP_ID
Definition: wincrypt.h:2837
#define AT_SIGNATURE
Definition: wincrypt.h:2240
ULONG_PTR HCRYPTKEY
Definition: wincrypt.h:58
#define ERROR_ARITHMETIC_OVERFLOW
Definition: winerror.h:623

Referenced by START_TEST().

◆ test_verify_detached_message_hash()

static void test_verify_detached_message_hash ( void  )
static

Definition at line 95 of file message.c.

96{
97 BOOL ret;
99 DWORD size, hashSize;
100 const BYTE *pMsgData = msgData;
101 BYTE hash[16];
102
103 if (0)
104 {
106 NULL);
107 }
108 memset(&para, 0, sizeof(para));
109 SetLastError(0xdeadbeef);
111 NULL);
113 "expected E_INVALIDARG, got %08lx\n", GetLastError());
114 para.cbSize = sizeof(para);
115 SetLastError(0xdeadbeef);
117 NULL);
119 "expected E_INVALIDARG, got %08lx\n", GetLastError());
121 SetLastError(0xdeadbeef);
123 NULL);
125 "expected CRYPT_E_ASN1_EOD, got %08lx\n", GetLastError());
127 SetLastError(0xdeadbeef);
129 NULL);
131 "expected E_INVALIDARG, got %08lx\n", GetLastError());
133 SetLastError(0xdeadbeef);
135 NULL);
137 "expected CRYPT_E_ASN1_EOD, got %08lx\n", GetLastError());
138 /* Curiously, passing no data to hash succeeds.. */
140 sizeof(detachedHashContent), 0, NULL, NULL, NULL, NULL);
142 ok(ret, "CryptVerifyDetachedMessageHash failed: %08lx\n", GetLastError());
143 /* as does passing the actual content of the message to hash.. */
144 size = sizeof(msgData);
145 pMsgData = msgData;
147 sizeof(detachedHashContent), 1, &pMsgData, &size, NULL, NULL);
148 ok(ret, "CryptVerifyDetachedMessageHash failed: %08lx\n", GetLastError());
149 /* while passing data to hash that isn't the content of the message fails.
150 */
151 size = sizeof(detachedHashContent);
152 pMsgData = detachedHashContent;
153 SetLastError(0xdeadbeef);
155 sizeof(detachedHashContent), 1, &pMsgData, &size, NULL, NULL);
157 "expected CRYPT_E_HASH_VALUE, got %08lx\n", GetLastError());
158 /* Getting the size of the hash while passing no hash data causes the
159 * hash to be checked (and fail.)
160 */
161 SetLastError(0xdeadbeef);
163 sizeof(detachedHashContent), 0, NULL, NULL, NULL, &hashSize);
165 "expected CRYPT_E_HASH_VALUE, got %08lx\n", GetLastError());
166 size = sizeof(msgData);
167 pMsgData = msgData;
169 sizeof(detachedHashContent), 1, &pMsgData, &size, NULL, &hashSize);
170 ok(ret, "CryptVerifyDetachedMessageHash failed: %08lx\n", GetLastError());
171 ok(hashSize == sizeof(hash), "unexpected size %ld\n", hashSize);
172 hashSize = 1;
173 SetLastError(0xdeadbeef);
175 sizeof(detachedHashContent), 1, &pMsgData, &size, hash, &hashSize);
177 "expected ERROR_MORE_DATA, got %08lx\n", GetLastError());
178 hashSize = sizeof(hash);
180 sizeof(detachedHashContent), 1, &pMsgData, &size, hash, &hashSize);
181 ok(ret, "CryptVerifyDetachedMessageHash failed: %08lx\n", GetLastError());
182}
#define ERROR_MORE_DATA
Definition: dderror.h:13
BOOL WINAPI CryptVerifyDetachedMessageHash(PCRYPT_HASH_MESSAGE_PARA pHashPara, BYTE *pbDetachedHashBlob, DWORD cbDetachedHashBlob, DWORD cToBeHashed, const BYTE *rgpbToBeHashed[], DWORD rgcbToBeHashed[], BYTE *pbComputedHash, DWORD *pcbComputedHash)
Definition: message.c:309
GLsizeiptr size
Definition: glext.h:5919
static BYTE detachedHashContent[]
Definition: message.c:87
static const BYTE msgData[]
Definition: message.c:93
Definition: _hash_fun.h:40
#define CRYPT_E_HASH_VALUE
Definition: winerror.h:4405

Referenced by START_TEST().

◆ test_verify_detached_message_signature()

static void test_verify_detached_message_signature ( void  )
static

Definition at line 319 of file message.c.

320{
322 BOOL ret;
323 const BYTE *pContent;
324 DWORD cbContent;
325
326 memset(&para, 0, sizeof(para));
327 SetLastError(0xdeadbeef);
329 NULL, NULL);
331 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
332 SetLastError(0xdeadbeef);
334 NULL, NULL);
336 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
337 para.cbSize = sizeof(para);
338 SetLastError(0xdeadbeef);
340 NULL, NULL);
342 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
344 SetLastError(0xdeadbeef);
346 NULL, NULL);
348 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
350 SetLastError(0xdeadbeef);
352 NULL, NULL);
353 ok(!ret, "Expected 0, got %d\n", ret);
355 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GetLastError());
356 /* None of these messages contains a cert in the message itself, so the
357 * default callback isn't able to verify their signature.
358 */
359 SetLastError(0xdeadbeef);
361 sizeof(signedWithCertContent), 0, NULL, NULL, NULL);
362 ok(!ret, "Expected 0, got %d\n", ret);
365 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
366 SetLastError(0xdeadbeef);
368 sizeof(signedContent), 0, NULL, NULL, NULL);
369 ok(!ret, "Expected 0, got %d\n", ret);
371 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
372 SetLastError(0xdeadbeef);
374 sizeof(detachedSignedContent), 0, NULL, NULL, NULL);
375 ok(!ret, "Expected 0, got %d\n", ret);
377 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
378 SetLastError(0xdeadbeef);
379 pContent = msgData;
380 cbContent = sizeof(msgData);
382 sizeof(detachedSignedContent), 1, &pContent, &cbContent, NULL);
383 ok(!ret, "Expected 0, got %d\n", ret);
385 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
386 /* Passing the correct callback results in success */
389 sizeof(detachedSignedContent), 1, &pContent, &cbContent, NULL);
390 ok(ret, "CryptVerifyDetachedMessageSignature failed: %08lx\n",
391 GetLastError());
392 /* Not passing the correct data to be signed results in the signature not
393 * matching.
394 */
395 SetLastError(0xdeadbeef);
397 sizeof(detachedSignedContent), 0, NULL, NULL, NULL);
398 ok(!ret, "Expected 0, got %d\n", ret);
400 "Expected NTE_BAD_SIGNATURE, got %08lx\n", GetLastError());
401}
BOOL WINAPI CryptVerifyDetachedMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex, const BYTE *pbDetachedSignBlob, DWORD cbDetachedSignBlob, DWORD cToBeSigned, const BYTE *rgpbToBeSigned[], DWORD rgcbToBeSigned[], PCCERT_CONTEXT *ppSignerCert)
Definition: message.c:108
static PCCERT_CONTEXT WINAPI msg_get_signer_callback(void *pvArg, DWORD certEncodingType, PCERT_INFO signerId, HCERTSTORE store)
Definition: message.c:312
static const BYTE signedContent[]
Definition: message.c:269
static const BYTE detachedSignedContent[]
Definition: message.c:283
static const BYTE signedWithCertContent[]
Definition: message.c:247
PFN_CRYPT_GET_SIGNER_CERTIFICATE pfnGetSignerCertificate
Definition: wincrypt.h:1687
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:4421
#define NTE_BAD_SIGNATURE
Definition: winerror.h:4253

Referenced by START_TEST().

◆ test_verify_message_hash()

static void test_verify_message_hash ( void  )
static

Definition at line 191 of file message.c.

192{
193 BOOL ret;
195 DWORD size;
196 BYTE *buf = NULL;
197
198 memset(&para, 0, sizeof(para));
199 /* Crash */
200 if (0)
202 SetLastError(0xdeadbeef);
205 "expected E_INVALIDARG, got %08lx\n", GetLastError());
206 para.cbSize = sizeof(para);
207 SetLastError(0xdeadbeef);
210 "expected E_INVALIDARG, got %08lx\n", GetLastError());
212 SetLastError(0xdeadbeef);
214 ok(!ret, "Expected 0, got %d\n", ret);
216 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GetLastError());
217 /* Verifying the hash of a detached message succeeds? */
221 ok(ret, "CryptVerifyMessageHash failed: %08lx\n", GetLastError());
222 /* As does verifying the hash of a regular message. */
224 NULL, NULL, NULL, NULL);
225 ok(ret, "CryptVerifyMessageHash failed: %08lx\n", GetLastError());
227 NULL, &size, NULL, NULL);
228 ok(ret, "CryptVerifyMessageHash failed: %08lx\n", GetLastError());
229 if (ret)
231 if (buf)
232 {
233 size = 1;
235 buf, &size, NULL, NULL);
237 "expected ERROR_MORE_DATA, got %08lx\n", GetLastError());
239 buf, &size, NULL, NULL);
240 ok(ret, "CryptVerifyMessageHash failed: %08lx\n", GetLastError());
241 ok(size == sizeof(msgData), "unexpected size %ld\n", size);
242 ok(!memcmp(buf, msgData, size), "unexpected value\n");
244 }
245}
BOOL WINAPI CryptVerifyMessageHash(PCRYPT_HASH_MESSAGE_PARA pHashPara, BYTE *pbHashedBlob, DWORD cbHashedBlob, BYTE *pbToBeHashed, DWORD *pcbToBeHashed, BYTE *pbComputedHash, DWORD *pcbComputedHash)
Definition: message.c:364
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static BYTE hashContent[]
Definition: message.c:184

Referenced by START_TEST().

◆ test_verify_message_signature()

static void test_verify_message_signature ( void  )
static

Definition at line 467 of file message.c.

468{
469 BOOL ret;
470 CRYPT_VERIFY_MESSAGE_PARA para = { 0 };
472 DWORD cbDecoded;
473 BYTE decoded[sizeof(msgData)];
474
475 SetLastError(0xdeadbeef);
478 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
479 /* Is cbDecoded set when invalid parameters are passed? */
480 cbDecoded = 0xdeadbeef;
481 ret = CryptVerifyMessageSignature(NULL, 0, NULL, 0, NULL, &cbDecoded,
482 NULL);
484 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
485 ok(cbDecoded == 0, "expected 0, got %08lx\n", cbDecoded);
486 SetLastError(0xdeadbeef);
487 ret = CryptVerifyMessageSignature(&para, 0, NULL, 0, NULL, 0, NULL);
489 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
490 para.cbSize = sizeof(para);
491 SetLastError(0xdeadbeef);
492 ret = CryptVerifyMessageSignature(&para, 0, NULL, 0, NULL, 0, NULL);
494 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
495 para.cbSize = 0;
497 SetLastError(0xdeadbeef);
498 ret = CryptVerifyMessageSignature(&para, 0, NULL, 0, NULL, 0, NULL);
500 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
501 para.cbSize = sizeof(para);
502 SetLastError(0xdeadbeef);
503 ret = CryptVerifyMessageSignature(&para, 0, NULL, 0, NULL, 0, NULL);
505 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GetLastError());
506 /* Check whether cert is set on error */
507 cert = (PCCERT_CONTEXT)0xdeadbeef;
508 ret = CryptVerifyMessageSignature(&para, 0, NULL, 0, NULL, 0, &cert);
510 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GetLastError());
511 ok(cert == NULL, "Expected NULL cert\n");
512 /* Check whether cbDecoded is set on error */
513 cbDecoded = 0xdeadbeef;
514 ret = CryptVerifyMessageSignature(&para, 0, NULL, 0, NULL, &cbDecoded,
515 NULL);
517 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GetLastError());
518 ok(!cbDecoded, "Expected 0\n");
519 SetLastError(0xdeadbeef);
521 sizeof(dataEmptyBareContent), NULL, 0, NULL);
523 "Expected CRYPT_E_ASN1_BADTAG, got %08lx\n", GetLastError());
525 "Expected CRYPT_E_ASN1_BADTAG, got %08lx\n", GetLastError());
526 SetLastError(0xdeadbeef);
528 sizeof(dataEmptyContent), NULL, 0, NULL);
530 "Expected CRYPT_E_UNEXPECTED_MSG_TYPE, got %08lx\n", GetLastError());
531 SetLastError(0xdeadbeef);
533 sizeof(signedEmptyBareContent), NULL, 0, NULL);
535 "Expected CRYPT_E_ASN1_BADTAG, got %08lx\n", GetLastError());
536 SetLastError(0xdeadbeef);
538 sizeof(signedEmptyContent), NULL, 0, NULL);
540 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
541 SetLastError(0xdeadbeef);
543 sizeof(signedContent), NULL, 0, NULL);
545 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
546 /* FIXME: Windows fails with CRYPT_E_NOT_FOUND for these messages, but
547 * their signer certs have invalid public keys that fail to decode. In
548 * Wine therefore the failure is an ASN error. Need some messages with
549 * valid public keys and invalid signatures to check against.
550 */
553 ok(!ret, "Expected failure\n");
555 sizeof(signedWithCertContent), NULL, 0, NULL);
556 ok(!ret, "Expected failure\n");
559 ok(!ret, "Expected failure\n");
560 /* Apparently, an output pcbDecoded parameter is expected. */
565 ok(!ret, "Expected failure\n");
566 /* Finally, a message signed with a valid public key verifies successfully
567 */
568 cbDecoded = 0xdeadbeef;
571 sizeof(signedWithCertWithValidPubKeyContent), NULL, &cbDecoded, NULL);
572 ok(ret, "CryptVerifyMessageSignature failed: %08lx\n", GetLastError());
573 ok(cbDecoded == sizeof(msgData), "expected 4, got %ld\n", cbDecoded);
574 cbDecoded = 0;
577 sizeof(signedWithCertWithValidPubKeyContent), NULL, &cbDecoded, NULL);
578 /* Setting cbDecoded to 0 succeeds when a NULL buffer is provided */
579 ok(ret, "CryptVerifyMessageSignature failed: %08lx\n", GetLastError());
580 ok(cbDecoded == sizeof(msgData), "expected 4, got %ld\n", cbDecoded);
581 cbDecoded = 0;
584 sizeof(signedWithCertWithValidPubKeyContent), decoded, &cbDecoded, NULL);
585 /* When a non-NULL buffer is provided, cbDecoded must not be too small */
587 "expected ERROR_MORE_DATA, got %ld (%08lx)\n", GetLastError(),
588 GetLastError());
589}
BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex, const BYTE *pbSignedBlob, DWORD cbSignedBlob, BYTE *pbDecoded, DWORD *pcbDecoded, PCCERT_CONTEXT *ppSignerCert)
Definition: message.c:184
static const BYTE signedWithCertWithPubKeyContent[]
Definition: message.c:420
static const BYTE signedWithCertEmptyContent[]
Definition: message.c:403
static const BYTE signedWithCertWithValidPubKeyContent[]
Definition: message.c:438
static BYTE cert[]
Definition: msg.c:1374
const CERT_CONTEXT * PCCERT_CONTEXT
Definition: wincrypt.h:494
#define CRYPT_E_UNEXPECTED_MSG_TYPE
Definition: winerror.h:4427

Referenced by START_TEST().

Variable Documentation

◆ cert1

const BYTE cert1[]
static
Initial value:
= {
0x30,0x81,0xd0,0x30,0x81,0xbe,0xa0,0x03,0x02,0x01,0x02,0x02,0x10,0x20,0x42,
0x68,0x69,0xe9,0xea,0x61,0x83,0x11,0xdf,0xc0,0x24,0x2f,0x3b,0xad,0x40,0x30,
0x09,0x06,0x05,0x2b,0x0e,0x03,0x02,0x1d,0x05,0x00,0x30,0x0c,0x31,0x0a,0x30,
0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x4e,0x30,0x20,0x17,0x0d,0x31,0x30,
0x30,0x39,0x31,0x34,0x31,0x33,0x31,0x39,0x30,0x39,0x5a,0x18,0x0f,0x33,0x30,
0x31,0x30,0x30,0x39,0x31,0x34,0x31,0x33,0x31,0x39,0x30,0x39,0x5a,0x30,0x0c,
0x31,0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x4e,0x30,0x5c,0x30,
0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,
0x4b,0x00,0x30,0x48,0x02,0x41,0x00,0xe8,0xa9,0xc0,0x99,0x82,0x64,0x87,0x1b,
0xf3,0x39,0xf0,0x8d,0xa3,0xdd,0x92,0x87,0xca,0x95,0x4f,0xe6,0xfc,0xe0,0x2d,
0x29,0x28,0x98,0x95,0x4c,0x3c,0x78,0xcd,0x3e,0x8a,0xaa,0x4a,0xd7,0x7b,0x07,
0xc1,0xf7,0x9c,0x71,0x0c,0xb9,0xe3,0x17,0x96,0xc5,0x39,0xdd,0x1d,0x06,0x6a,
0x1e,0x94,0x09,0x9e,0x50,0x09,0x5b,0xd9,0x60,0xd9,0x9b,0x02,0x03,0x01,0x00,
0x01,0x30,0x09,0x06,0x05,0x2b,0x0e,0x03,0x02,0x1d,0x05,0x00,0x03,0x02,0x00,
0xc1 }

Definition at line 781 of file message.c.

Referenced by cert_mgr_sort_by_date(), test_encrypt_message(), test_sign_message(), testGetIssuerCert(), testIsValidCRLForCert(), testRegStoreSavedCerts(), and testStoresInCollection().

◆ cert2

const BYTE cert2[]
static
Initial value:
= {
0x30,0x82,0x01,0x15,0x30,0x82,0x01,0x02,0xa0,0x03,0x02,0x01,0x02,0x02,0x10,
0x1c,0xf2,0x1f,0xec,0x6b,0xdc,0x36,0xbf,0x4a,0xd7,0xe1,0x6c,0x84,0x85,0xcd,
0x2e,0x30,0x09,0x06,0x05,0x2b,0x0e,0x03,0x02,0x1d,0x05,0x00,0x30,0x0c,0x31,
0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x58,0x30,0x20,0x17,0x0d,
0x31,0x30,0x30,0x37,0x31,0x32,0x31,0x31,0x33,0x37,0x35,0x36,0x5a,0x18,0x0f,
0x33,0x30,0x31,0x30,0x30,0x37,0x31,0x32,0x31,0x31,0x33,0x37,0x35,0x36,0x5a,
0x30,0x0c,0x31,0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x58,0x30,
0x81,0x9f,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,
0x05,0x00,0x03,0x81,0x8d,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xab,0xed,
0x6e,0xe0,0x00,0x3c,0xcf,0x2d,0x2b,0xda,0x05,0x88,0x6a,0x7e,0xed,0x60,0x30,
0x24,0xef,0x6c,0x6b,0xad,0x28,0x9b,0x14,0x90,0xf6,0xd0,0x96,0x79,0x6d,0xad,
0xac,0x46,0x14,0x7b,0x0e,0xfe,0xa9,0x8a,0x05,0x5a,0xc8,0x84,0x38,0x44,0xf9,
0xce,0xb2,0xe6,0xde,0x5b,0x80,0x0b,0x15,0xff,0x1b,0x60,0x3f,0xba,0xb2,0xfe,
0x6e,0xf5,0xdc,0x54,0x33,0xfc,0xfc,0x79,0x0a,0x10,0xa4,0x23,0x6d,0x67,0xeb,
0x16,0xb2,0x92,0xbf,0x63,0x42,0x17,0x0a,0xde,0xe6,0xab,0x8e,0xf7,0x8e,0x41,
0x8c,0x04,0xe8,0xe2,0x38,0x73,0xd3,0x82,0xd7,0xd1,0xee,0xd3,0xa6,0x54,0x8c,
0xcd,0x0b,0x93,0xda,0x63,0x55,0x0d,0x1f,0x68,0x5c,0x30,0xee,0xad,0x2d,0xd5,
0x40,0x56,0xe0,0xd8,0xc7,0xef,0x02,0x03,0x01,0x00,0x01,0x30,0x09,0x06,0x05,
0x2b,0x0e,0x03,0x02,0x1d,0x05,0x00,0x03,0x02,0x00,0x06 }

Definition at line 797 of file message.c.

Referenced by cert_mgr_sort_by_date(), test_encrypt_message(), testCertRegisterSystemStore(), testEmptyStore(), testGetIssuerCert(), testIsValidCRLForCert(), testRegStoreSavedCerts(), and testStoresInCollection().

◆ crl

const BYTE crl[]
static
Initial value:
= {
0x30,0x81,0xc2,0x30,0x7e,0x02,0x01,0x01,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,
0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x30,0x3c,0x31,0x0b,0x30,0x09,0x06,
0x03,0x55,0x04,0x06,0x13,0x02,0x52,0x55,0x31,0x0c,0x30,0x0a,0x06,0x03,0x55,
0x04,0x08,0x13,0x03,0x53,0x50,0x62,0x31,0x0c,0x30,0x0a,0x06,0x03,0x55,0x04,
0x07,0x13,0x03,0x53,0x50,0x62,0x31,0x11,0x30,0x0f,0x06,0x03,0x55,0x04,0x0a,
0x13,0x08,0x45,0x74,0x65,0x72,0x73,0x6f,0x66,0x74,0x17,0x0d,0x31,0x30,0x30,
0x36,0x32,0x38,0x31,0x32,0x35,0x31,0x32,0x37,0x5a,0x17,0x0d,0x31,0x30,0x30,
0x37,0x32,0x38,0x31,0x32,0x35,0x31,0x32,0x37,0x5a,0xa0,0x0e,0x30,0x0c,0x30,
0x0a,0x06,0x03,0x55,0x1d,0x14,0x04,0x03,0x02,0x01,0x00,0x30,0x0d,0x06,0x09,
0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x03,0x31,0x00,0x83,
0x35,0x9c,0xf5,0x35,0x5c,0xc1,0x20,0x81,0x80,0x5c,0x35,0x56,0xaf,0xb3,0x27,
0x15,0xc6,0xdd,0x24,0xe1,0xff,0xb9,0xf9,0x19,0x21,0xed,0x5e,0x1b,0xff,0x72,
0xc3,0x33,0xf6,0x9f,0xcb,0xde,0x84,0x0b,0x12,0x84,0xad,0x48,0x90,0x9d,0xdd,
0x89,0xbb }

Definition at line 817 of file message.c.

Referenced by CertAddEncodedCRLToStore(), CertCreateCRLContext(), CertVerifySubjectCertificateContext(), check_store_context_type(), Collection_addCRL(), Collection_deleteCRL(), compare_crl_existing(), countCRLsInStore(), CRL_clone(), CRL_free(), CRLContext_GetHashProp(), CRLContext_GetProperty(), CRLContext_SetProperty(), CRYPT_FileWriteCRL(), CRYPT_FindCertificateInCRL(), CRYPT_RegWriteCRL(), CRYPT_SavePKCSToMem(), export_append_extension(), import_crl(), import_store(), MemStore_addCRL(), ProvStore_addCRL(), ProvStore_deleteCRL(), test_crypt_ui_wiz_import(), test_retrieveObjectByUrl(), test_sign_message(), testCloseStore(), testEmptyStore(), testFileNameStore(), testFindCertInCRL(), testIsValidCRLForCert(), testMessageStore(), testSerializedStore(), testVerifyCRLRevocation(), verify_cert_revocation(), verify_cert_revocation_from_dist_points_ext(), verify_cert_revocation_with_crl_offline(), and verify_cert_revocation_with_crl_online().

◆ dataEmptyBareContent

const BYTE dataEmptyBareContent[] = { 0x04,0x00 }
static

Definition at line 30 of file message.c.

Referenced by test_msg_get_signer_count(), and test_verify_message_signature().

◆ dataEmptyContent

const BYTE dataEmptyContent[]
static
Initial value:
= {
0x30,0x0f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x02,
0x04,0x00 }

Definition at line 31 of file message.c.

Referenced by test_msg_get_signer_count(), and test_verify_message_signature().

◆ detachedHashBlob

const BYTE detachedHashBlob[]
static
Initial value:
= {
0x30,0x3f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x05,0xa0,0x32,
0x30,0x30,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x07,0x01,0x04,0x10,0x2d,0x1b,0xbc,0x1f,0xc7,0xab,0x36,0x8d,0xdb,0x95,0xe6,
0x24,0xb9,0x66,0x7c,0x21 }

Definition at line 591 of file message.c.

Referenced by test_hash_message().

◆ detachedHashContent

BYTE detachedHashContent[]
static
Initial value:
= {
0x30,0x3f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x05,0xa0,0x32,
0x30,0x30,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x07,0x01,0x04,0x10,0x08,0xd6,0xc0,0x5a,0x21,0x51,0x2a,0x79,0xa1,0xdf,0xeb,
0x9d,0x2a,0x8f,0x26,0x2f }

Definition at line 87 of file message.c.

Referenced by test_verify_detached_message_hash(), and test_verify_message_hash().

◆ detachedSignedContent

const BYTE detachedSignedContent[]
static
Initial value:
= {
0x30,0x81,0xaa,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,
0x81,0x9c,0x30,0x81,0x99,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0x31,0x77,0x30,0x75,0x02,0x01,0x01,0x30,
0x1a,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,
0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,0x30,0x0c,0x06,
0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x04,0x06,0x00,
0x05,0x00,0x04,0x40,0x81,0xa6,0x70,0xb3,0xef,0x59,0xd1,0x66,0xd1,0x9b,0xc0,
0x9a,0xb6,0x9a,0x5e,0x6d,0x6f,0x6d,0x0d,0x59,0xa9,0xaa,0x6e,0xe9,0x2c,0xa0,
0x1e,0xee,0xc2,0x60,0xbc,0x59,0xbe,0x3f,0x63,0x06,0x8d,0xc9,0x11,0x1d,0x23,
0x64,0x92,0xef,0x2e,0xfc,0x57,0x29,0xa4,0xaf,0xe0,0xee,0x93,0x19,0x39,0x51,
0xe4,0x44,0xb8,0x0b,0x28,0xf4,0xa8,0x0d }

Definition at line 283 of file message.c.

Referenced by test_verify_detached_message_signature().

◆ encryptedMessage

const BYTE encryptedMessage[]
static
Initial value:
= {
0x30,0x31,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x03,0xa0,0x24,
0x30,0x22,0x02,0x01,0x00,0x31,0x00,0x30,0x1b,0x06,0x09,0x2a,0x86,0x48,0x86,
0xf7,0x0d,0x01,0x07,0x01,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x03,0x04,0x05,0x00,0x80,0x00 }

Definition at line 1150 of file message.c.

Referenced by test_encrypt_message().

◆ hashBlob

const BYTE hashBlob[]
static
Initial value:
= {
0x30,0x47,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x05,0xa0,0x3a,
0x30,0x38,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x13,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x07,0x01,0xa0,0x06,0x04,0x04,0xde,0xad,0xbe,0xef,0x04,0x10,0x2f,0x24,0x92,
0x30,0xa8,0xe7,0xc2,0xbf,0x60,0x05,0xcc,0xd2,0x67,0x92,0x59,0xec }

Definition at line 597 of file message.c.

Referenced by CDecodeHashMsg_VerifyHash(), and test_hash_message().

◆ hashContent

BYTE hashContent[]
static
Initial value:
= {
0x30,0x47,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x05,0xa0,0x3a,
0x30,0x38,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x13,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x07,0x01,0xa0,0x06,0x04,0x04,0x01,0x02,0x03,0x04,0x04,0x10,0x08,0xd6,0xc0,
0x5a,0x21,0x51,0x2a,0x79,0xa1,0xdf,0xeb,0x9d,0x2a,0x8f,0x26,0x2f }

Definition at line 184 of file message.c.

Referenced by test_verify_message_hash().

◆ hashVal

const BYTE hashVal[]
static
Initial value:
= {
0x2d,0x1b,0xbc,0x1f,0xc7,0xab,0x36,0x8d,0xdb,0x95,0xe6,0x24,0xb9,0x66,0x7c,
0x21 }

Definition at line 603 of file message.c.

Referenced by test_hash_message(), and testAddSerialized().

◆ msgData

◆ publicPrivateKeyPair

const BYTE publicPrivateKeyPair[]
static
Initial value:
= {
0x07,0x02,0x00,0x00,0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x32,0x00,0x02,0x00,
0x00,0x01,0x00,0x01,0x00,0x9b,0xd9,0x60,0xd9,0x5b,0x09,0x50,0x9e,0x09,0x94,
0x1e,0x6a,0x06,0x1d,0xdd,0x39,0xc5,0x96,0x17,0xe3,0xb9,0x0c,0x71,0x9c,0xf7,
0xc1,0x07,0x7b,0xd7,0x4a,0xaa,0x8a,0x3e,0xcd,0x78,0x3c,0x4c,0x95,0x98,0x28,
0x29,0x2d,0xe0,0xfc,0xe6,0x4f,0x95,0xca,0x87,0x92,0xdd,0xa3,0x8d,0xf0,0x39,
0xf3,0x1b,0x87,0x64,0x82,0x99,0xc0,0xa9,0xe8,0x87,0x86,0x2e,0x72,0x07,0x07,
0x8f,0x45,0x54,0x51,0x2f,0x51,0xd0,0x60,0x97,0x48,0x54,0x0e,0x78,0xb5,0x7e,
0x2b,0x9d,0xca,0x81,0xa8,0xa8,0x00,0x57,0x69,0xa6,0xf7,0x4d,0x45,0xe0,0xf7,
0xfa,0xd2,0xeb,0xaa,0xb8,0x06,0x34,0xce,0xf0,0x9d,0x2b,0x76,0x8a,0x4f,0x70,
0x51,0x90,0x33,0x72,0xcb,0x81,0x85,0x7e,0x35,0x2e,0xfb,0x81,0xf0,0xc7,0x85,
0xa5,0x75,0xf9,0x2d,0x00,0x71,0x66,0x36,0xfe,0x22,0xd6,0xc9,0x36,0x61,0x9b,
0x64,0x92,0xe8,0x25,0x38,0x35,0xeb,0x0c,0x84,0x83,0x76,0x42,0x90,0xf7,0x73,
0x91,0xdc,0x43,0x83,0x07,0x77,0xc9,0x1b,0x3f,0x74,0xc0,0xbe,0x18,0x97,0xd6,
0x86,0xe5,0xfa,0x28,0x7c,0xf7,0x8d,0x89,0xb1,0x93,0xac,0x48,0x3c,0xa1,0x02,
0xfa,0xc6,0x1c,0xa0,0xb5,0xe8,0x4f,0xd7,0xd1,0x33,0x63,0x8b,0x7e,0xf1,0x94,
0x56,0x07,0xbc,0x6e,0x0c,0xbd,0xa0,0x15,0xba,0x99,0x5d,0xb7,0x5e,0x09,0xf2,
0x1b,0x46,0x85,0x61,0x91,0x6a,0x78,0x31,0xb5,0xf0,0xba,0x20,0xf5,0x7a,0xb4,
0x8e,0xd3,0x50,0x87,0xf8,0xf3,0xe4,0xd9,0xab,0x6f,0x0e,0x59,0x42,0xac,0x7d,
0xb1,0x8c,0xea,0x33,0x54,0x08,0x38,0xc9,0xcd,0xac,0x10,0x19,0x4a,0xba,0x89,
0xdc,0xb6,0x73,0xef,0xec,0x56,0x93,0xd6,0xf2,0x4b,0xba,0x50,0x2d,0x8f,0x15,
0xed,0x8b,0xb5,0x67,0xc8,0xfc,0x51,0x5f }

Definition at line 759 of file message.c.

Referenced by test_sign_message().

◆ signedContent

const BYTE signedContent[]
static
Initial value:
= {
0x30,0x81,0xb2,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,
0x81,0xa4,0x30,0x81,0xa1,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x13,0x06,0x09,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x06,0x04,0x04,0x01,0x02,0x03,0x04,
0x31,0x77,0x30,0x75,0x02,0x01,0x01,0x30,0x1a,0x30,0x15,0x31,0x13,0x30,0x11,
0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,
0x67,0x00,0x02,0x01,0x01,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x04,0x06,0x00,0x05,0x00,0x04,0x40,0x81,0xa6,0x70,
0xb3,0xef,0x59,0xd1,0x66,0xd1,0x9b,0xc0,0x9a,0xb6,0x9a,0x5e,0x6d,0x6f,0x6d,
0x0d,0x59,0xa9,0xaa,0x6e,0xe9,0x2c,0xa0,0x1e,0xee,0xc2,0x60,0xbc,0x59,0xbe,
0x3f,0x63,0x06,0x8d,0xc9,0x11,0x1d,0x23,0x64,0x92,0xef,0x2e,0xfc,0x57,0x29,
0xa4,0xaf,0xe0,0xee,0x93,0x19,0x39,0x51,0xe4,0x44,0xb8,0x0b,0x28,0xf4,0xa8,
0x0d }

Definition at line 269 of file message.c.

Referenced by test_verify_detached_message_signature(), and test_verify_message_signature().

◆ signedData

const BYTE signedData[]
static
Initial value:
= {
0x30,0x81,0xc3,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,
0x81,0xb5,0x30,0x81,0xb2,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x13,0x06,0x09,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x06,0x04,0x04,0x01,0x02,0x03,0x04,
0x31,0x81,0x87,0x30,0x81,0x84,0x02,0x01,0x01,0x30,0x20,0x30,0x0c,0x31,0x0a,
0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x4e,0x02,0x10,0x20,0x42,0x68,
0x69,0xe9,0xea,0x61,0x83,0x11,0xdf,0xc0,0x24,0x2f,0x3b,0xad,0x40,0x30,0x0c,
0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0d,0x06,
0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x04,0x40,0xe4,
0x69,0xf5,0x62,0xfb,0x3a,0x7d,0x1c,0x7b,0x8b,0xcc,0xfc,0x6e,0x8e,0x91,0x85,
0xcf,0x3c,0xb8,0xfd,0x8a,0xac,0x81,0x96,0xa0,0x42,0xac,0x88,0xc4,0x48,0xe8,
0x43,0x64,0xd1,0x38,0xd2,0x6c,0xc4,0xd4,0x9b,0x9a,0xd4,0x33,0x02,0xef,0x88,
0xef,0x98,0x2d,0xac,0xad,0xc1,0x93,0x60,0xc4,0x3a,0xdc,0xa7,0xd6,0x97,0x70,
0x01,0xc1,0x84 }

Definition at line 931 of file message.c.

Referenced by test_sign_message().

◆ signedEmptyBareContent

const BYTE signedEmptyBareContent[]
static
Initial value:
= {
0x30,0x50,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,
0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x02,0x06,0x00,0x31,0x37,0x30,0x35,0x02,
0x01,0x01,0x30,0x1a,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,
0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,
0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,
0x04,0x06,0x00,0x05,0x00,0x04,0x00 }

Definition at line 34 of file message.c.

Referenced by test_msg_get_signer_count(), and test_verify_message_signature().

◆ signedEmptyContent

const BYTE signedEmptyContent[]
static
Initial value:
= {
0x30,0x5f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,0x52,
0x30,0x50,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,
0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x02,0x06,0x00,0x31,0x37,0x30,0x35,0x02,
0x01,0x01,0x30,0x1a,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,
0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,
0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,
0x04,0x06,0x00,0x05,0x00,0x04,0x00 }

Definition at line 41 of file message.c.

Referenced by test_msg_get_signer_count(), and test_verify_message_signature().

◆ signedEmptyMessage

const BYTE signedEmptyMessage[]
static
Initial value:
= {
0x30,0x81,0xbb,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,
0x81,0xad,0x30,0x81,0xaa,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0x31,0x81,0x87,0x30,0x81,0x84,0x02,0x01,
0x01,0x30,0x20,0x30,0x0c,0x31,0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,
0x01,0x4e,0x02,0x10,0x20,0x42,0x68,0x69,0xe9,0xea,0x61,0x83,0x11,0xdf,0xc0,
0x24,0x2f,0x3b,0xad,0x40,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x01,0x01,0x05,0x00,0x04,0x40,0xe1,0xee,0xca,0x98,0x16,0x23,0x5a,0x34,0xfd,
0x91,0x69,0x97,0x1e,0x16,0xe4,0x57,0x45,0xad,0xc9,0x5d,0x2e,0xda,0x92,0xbf,
0xee,0x2f,0xb1,0xaa,0x32,0xfa,0x07,0x4e,0x63,0xfd,0xe1,0x52,0x17,0xd0,0xa4,
0x49,0x30,0x54,0x4d,0x12,0xa0,0x6a,0x1c,0x64,0xea,0xc7,0x50,0x49,0xa5,0xca,
0xc3,0x71,0xa4,0xf7,0x8c,0x25,0xe4,0x1a,0xca,0x89 }

Definition at line 846 of file message.c.

Referenced by test_sign_message().

◆ signedHash

const BYTE signedHash[]
static
Initial value:
= {
0x30,0x81,0xbb,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,
0x81,0xad,0x30,0x81,0xaa,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0x31,0x81,0x87,0x30,0x81,0x84,0x02,0x01,
0x01,0x30,0x20,0x30,0x0c,0x31,0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,
0x01,0x4e,0x02,0x10,0x20,0x42,0x68,0x69,0xe9,0xea,0x61,0x83,0x11,0xdf,0xc0,
0x24,0x2f,0x3b,0xad,0x40,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x01,0x01,0x05,0x00,0x04,0x40,0x1e,0x04,0xa4,0xe3,0x90,0x54,0xed,0xcb,0x94,
0xa2,0xbe,0x81,0x73,0x7e,0x05,0xf2,0x82,0xd3,0x3a,0x26,0x96,0x7a,0x53,0xcd,
0x05,0xc3,0x09,0x69,0x3d,0x12,0x6c,0xb1,0xb0,0xab,0x0e,0xa1,0xec,0x1b,0xa1,
0xff,0x01,0x9c,0x49,0x9f,0x4b,0x69,0x59,0x74,0x20,0x9f,0xb0,0x19,0x95,0xe7,
0xed,0x1e,0x84,0xeb,0xe2,0x53,0x2c,0xa6,0x43,0xdf }

Definition at line 860 of file message.c.

Referenced by test_sign_message().

◆ signedHashForEmptyMessage

const BYTE signedHashForEmptyMessage[]
static
Initial value:
= {
0x30,0x81,0xbb,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,
0x81,0xad,0x30,0x81,0xaa,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0x31,0x81,0x87,0x30,0x81,0x84,0x02,0x01,
0x01,0x30,0x20,0x30,0x0c,0x31,0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,
0x01,0x4e,0x02,0x10,0x20,0x42,0x68,0x69,0xe9,0xea,0x61,0x83,0x11,0xdf,0xc0,
0x24,0x2f,0x3b,0xad,0x40,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x01,0x01,0x05,0x00,0x04,0x40,0xe1,0xee,0xca,0x98,0x16,0x23,0x5a,0x34,0xfd,
0x91,0x69,0x97,0x1e,0x16,0xe4,0x57,0x45,0xad,0xc9,0x5d,0x2e,0xda,0x92,0xbf,
0xee,0x2f,0xb1,0xaa,0x32,0xfa,0x07,0x4e,0x63,0xfd,0xe1,0x52,0x17,0xd0,0xa4,
0x49,0x30,0x54,0x4d,0x12,0xa0,0x6a,0x1c,0x64,0xea,0xc7,0x50,0x49,0xa5,0xca,
0xc3,0x71,0xa4,0xf7,0x8c,0x25,0xe4,0x1a,0xca,0x89 }

Definition at line 832 of file message.c.

Referenced by test_sign_message().

◆ signedHashWithCert

const BYTE signedHashWithCert[]
static
Initial value:
= {
0x30,0x82,0x01,0x93,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,
0xa0,0x82,0x01,0x84,0x30,0x82,0x01,0x80,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,
0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0b,0x06,
0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x81,0xd3,0x30,0x81,
0xd0,0x30,0x81,0xbe,0xa0,0x03,0x02,0x01,0x02,0x02,0x10,0x20,0x42,0x68,0x69,
0xe9,0xea,0x61,0x83,0x11,0xdf,0xc0,0x24,0x2f,0x3b,0xad,0x40,0x30,0x09,0x06,
0x05,0x2b,0x0e,0x03,0x02,0x1d,0x05,0x00,0x30,0x0c,0x31,0x0a,0x30,0x08,0x06,
0x03,0x55,0x04,0x03,0x13,0x01,0x4e,0x30,0x20,0x17,0x0d,0x31,0x30,0x30,0x39,
0x31,0x34,0x31,0x33,0x31,0x39,0x30,0x39,0x5a,0x18,0x0f,0x33,0x30,0x31,0x30,
0x30,0x39,0x31,0x34,0x31,0x33,0x31,0x39,0x30,0x39,0x5a,0x30,0x0c,0x31,0x0a,
0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x4e,0x30,0x5c,0x30,0x0d,0x06,
0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x4b,0x00,
0x30,0x48,0x02,0x41,0x00,0xe8,0xa9,0xc0,0x99,0x82,0x64,0x87,0x1b,0xf3,0x39,
0xf0,0x8d,0xa3,0xdd,0x92,0x87,0xca,0x95,0x4f,0xe6,0xfc,0xe0,0x2d,0x29,0x28,
0x98,0x95,0x4c,0x3c,0x78,0xcd,0x3e,0x8a,0xaa,0x4a,0xd7,0x7b,0x07,0xc1,0xf7,
0x9c,0x71,0x0c,0xb9,0xe3,0x17,0x96,0xc5,0x39,0xdd,0x1d,0x06,0x6a,0x1e,0x94,
0x09,0x9e,0x50,0x09,0x5b,0xd9,0x60,0xd9,0x9b,0x02,0x03,0x01,0x00,0x01,0x30,
0x09,0x06,0x05,0x2b,0x0e,0x03,0x02,0x1d,0x05,0x00,0x03,0x02,0x00,0xc1,0x31,
0x81,0x87,0x30,0x81,0x84,0x02,0x01,0x01,0x30,0x20,0x30,0x0c,0x31,0x0a,0x30,
0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x4e,0x02,0x10,0x20,0x42,0x68,0x69,
0xe9,0xea,0x61,0x83,0x11,0xdf,0xc0,0x24,0x2f,0x3b,0xad,0x40,0x30,0x0c,0x06,
0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0d,0x06,0x09,
0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x04,0x40,0x1e,0x04,
0xa4,0xe3,0x90,0x54,0xed,0xcb,0x94,0xa2,0xbe,0x81,0x73,0x7e,0x05,0xf2,0x82,
0xd3,0x3a,0x26,0x96,0x7a,0x53,0xcd,0x05,0xc3,0x09,0x69,0x3d,0x12,0x6c,0xb1,
0xb0,0xab,0x0e,0xa1,0xec,0x1b,0xa1,0xff,0x01,0x9c,0x49,0x9f,0x4b,0x69,0x59,
0x74,0x20,0x9f,0xb0,0x19,0x95,0xe7,0xed,0x1e,0x84,0xeb,0xe2,0x53,0x2c,0xa6,
0x43,0xdf }

Definition at line 874 of file message.c.

Referenced by test_sign_message().

◆ signedHashWithCRL

const BYTE signedHashWithCRL[]
static
Initial value:
= {
0x30,0x82,0x01,0x85,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,
0xa0,0x82,0x01,0x76,0x30,0x82,0x01,0x72,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,
0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0b,0x06,
0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa1,0x81,0xc5,0x30,0x81,
0xc2,0x30,0x7e,0x02,0x01,0x01,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,
0x0d,0x01,0x01,0x05,0x05,0x00,0x30,0x3c,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,
0x04,0x06,0x13,0x02,0x52,0x55,0x31,0x0c,0x30,0x0a,0x06,0x03,0x55,0x04,0x08,
0x13,0x03,0x53,0x50,0x62,0x31,0x0c,0x30,0x0a,0x06,0x03,0x55,0x04,0x07,0x13,
0x03,0x53,0x50,0x62,0x31,0x11,0x30,0x0f,0x06,0x03,0x55,0x04,0x0a,0x13,0x08,
0x45,0x74,0x65,0x72,0x73,0x6f,0x66,0x74,0x17,0x0d,0x31,0x30,0x30,0x36,0x32,
0x38,0x31,0x32,0x35,0x31,0x32,0x37,0x5a,0x17,0x0d,0x31,0x30,0x30,0x37,0x32,
0x38,0x31,0x32,0x35,0x31,0x32,0x37,0x5a,0xa0,0x0e,0x30,0x0c,0x30,0x0a,0x06,
0x03,0x55,0x1d,0x14,0x04,0x03,0x02,0x01,0x00,0x30,0x0d,0x06,0x09,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x03,0x31,0x00,0x83,0x35,0x9c,
0xf5,0x35,0x5c,0xc1,0x20,0x81,0x80,0x5c,0x35,0x56,0xaf,0xb3,0x27,0x15,0xc6,
0xdd,0x24,0xe1,0xff,0xb9,0xf9,0x19,0x21,0xed,0x5e,0x1b,0xff,0x72,0xc3,0x33,
0xf6,0x9f,0xcb,0xde,0x84,0x0b,0x12,0x84,0xad,0x48,0x90,0x9d,0xdd,0x89,0xbb,
0x31,0x81,0x87,0x30,0x81,0x84,0x02,0x01,0x01,0x30,0x20,0x30,0x0c,0x31,0x0a,
0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x4e,0x02,0x10,0x20,0x42,0x68,
0x69,0xe9,0xea,0x61,0x83,0x11,0xdf,0xc0,0x24,0x2f,0x3b,0xad,0x40,0x30,0x0c,
0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x0d,0x06,
0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x04,0x40,0x1e,
0x04,0xa4,0xe3,0x90,0x54,0xed,0xcb,0x94,0xa2,0xbe,0x81,0x73,0x7e,0x05,0xf2,
0x82,0xd3,0x3a,0x26,0x96,0x7a,0x53,0xcd,0x05,0xc3,0x09,0x69,0x3d,0x12,0x6c,
0xb1,0xb0,0xab,0x0e,0xa1,0xec,0x1b,0xa1,0xff,0x01,0x9c,0x49,0x9f,0x4b,0x69,
0x59,0x74,0x20,0x9f,0xb0,0x19,0x95,0xe7,0xed,0x1e,0x84,0xeb,0xe2,0x53,0x2c,
0xa6,0x43,0xdf }

Definition at line 903 of file message.c.

Referenced by test_sign_message().

◆ signedWithCertContent

const BYTE signedWithCertContent[]
static
Initial value:
= {
0x30,0x82,0x01,0x32,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,
0xa0,0x82,0x01,0x23,0x30,0x82,0x01,0x1f,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,
0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x13,0x06,
0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x06,0x04,0x04,0x01,
0x02,0x03,0x04,0xa0,0x7c,0x30,0x7a,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,
0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,
0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x30,0x22,0x18,0x0f,0x31,0x36,0x30,0x31,
0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x18,0x0f,0x31,0x36,
0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30,0x15,
0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,
0x20,0x4c,0x61,0x6e,0x67,0x00,0x30,0x07,0x30,0x02,0x06,0x00,0x03,0x01,0x00,
0xa3,0x16,0x30,0x14,0x30,0x12,0x06,0x03,0x55,0x1d,0x13,0x01,0x01,0xff,0x04,
0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01,0x31,0x77,0x30,0x75,0x02,0x01,
0x01,0x30,0x1a,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,
0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,0x30,
0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x04,
0x06,0x00,0x05,0x00,0x04,0x40,0x81,0xa6,0x70,0xb3,0xef,0x59,0xd1,0x66,0xd1,
0x9b,0xc0,0x9a,0xb6,0x9a,0x5e,0x6d,0x6f,0x6d,0x0d,0x59,0xa9,0xaa,0x6e,0xe9,
0x2c,0xa0,0x1e,0xee,0xc2,0x60,0xbc,0x59,0xbe,0x3f,0x63,0x06,0x8d,0xc9,0x11,
0x1d,0x23,0x64,0x92,0xef,0x2e,0xfc,0x57,0x29,0xa4,0xaf,0xe0,0xee,0x93,0x19,
0x39,0x51,0xe4,0x44,0xb8,0x0b,0x28,0xf4,0xa8,0x0d }

Definition at line 247 of file message.c.

Referenced by test_verify_detached_message_signature(), and test_verify_message_signature().

◆ signedWithCertEmptyContent

const BYTE signedWithCertEmptyContent[]
static
Initial value:
= {
0x30,0x81,0xdf,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,
0x81,0xd1,0x30,0x81,0xce,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x02,0x06,0x00,0xa0,0x7c,
0x30,0x7a,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30,0x11,
0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,
0x67,0x00,0x30,0x22,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,
0x30,0x30,0x30,0x30,0x30,0x5a,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,
0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30,0x15,0x31,0x13,0x30,0x11,0x06,
0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,
0x00,0x30,0x07,0x30,0x02,0x06,0x00,0x03,0x01,0x00,0xa3,0x16,0x30,0x14,0x30,
0x12,0x06,0x03,0x55,0x1d,0x13,0x01,0x01,0xff,0x04,0x08,0x30,0x06,0x01,0x01,
0xff,0x02,0x01,0x01,0x31,0x37,0x30,0x35,0x02,0x01,0x01,0x30,0x1a,0x30,0x15,
0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,
0x20,0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,0x30,0x0c,0x06,0x08,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x04,0x06,0x00,0x05,0x00,0x04,
0x00 }

Definition at line 403 of file message.c.

Referenced by test_verify_message_signature().

◆ signedWithCertWithPubKeyContent

const BYTE signedWithCertWithPubKeyContent[]
static
Initial value:
= {
0x30,0x81,0xfc,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0,
0x81,0xee,0x30,0x81,0xeb,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x02,0x06,0x00,0xa0,0x81,
0x98,0x30,0x81,0x95,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,
0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,
0x61,0x6e,0x67,0x00,0x30,0x22,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,
0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,
0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30,0x15,0x31,0x13,0x30,
0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,
0x6e,0x67,0x00,0x30,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x01,0x01,0x01,0x05,0x00,0x03,0x11,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,
0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0xa3,0x16,0x30,0x14,0x30,0x12,
0x06,0x03,0x55,0x1d,0x13,0x01,0x01,0xff,0x04,0x08,0x30,0x06,0x01,0x01,0xff,
0x02,0x01,0x01,0x31,0x37,0x30,0x35,0x02,0x01,0x01,0x30,0x1a,0x30,0x15,0x31,
0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,
0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,
0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x04,0x06,0x00,0x05,0x00,0x04,0x00 }

Definition at line 420 of file message.c.

Referenced by test_verify_message_signature().

◆ signedWithCertWithValidPubKeyContent

const BYTE signedWithCertWithValidPubKeyContent[]
static
Initial value:
= {
0x30,0x82,0x01,0x89,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,
0xa0,0x82,0x01,0x7a,0x30,0x82,0x01,0x76,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,
0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x13,0x06,
0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x06,0x04,0x04,0x01,
0x02,0x03,0x04,0xa0,0x81,0xd2,0x30,0x81,0xcf,0x02,0x01,0x01,0x30,0x02,0x06,
0x00,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,
0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x30,0x22,0x18,0x0f,0x31,0x36,
0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x18,0x0f,
0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,
0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,
0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x30,0x5c,0x30,0x0d,0x06,0x09,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x4b,0x00,0x30,0x48,
0x02,0x41,0x00,0xe2,0x54,0x3a,0xa7,0x83,0xb1,0x27,0x14,0x3e,0x59,0xbb,0xb4,
0x53,0xe6,0x1f,0xe7,0x5d,0xf1,0x21,0x68,0xad,0x85,0x53,0xdb,0x6b,0x1e,0xeb,
0x65,0x97,0x03,0x86,0x60,0xde,0xf3,0x6c,0x38,0x75,0xe0,0x4c,0x61,0xbb,0xbc,
0x62,0x17,0xa9,0xcd,0x79,0x3f,0x21,0x4e,0x96,0xcb,0x0e,0xdc,0x61,0x94,0x30,
0x18,0x10,0x6b,0xd0,0x1c,0x10,0x79,0x02,0x03,0x01,0x00,0x01,0xa3,0x16,0x30,
0x14,0x30,0x12,0x06,0x03,0x55,0x1d,0x13,0x01,0x01,0xff,0x04,0x08,0x30,0x06,
0x01,0x01,0xff,0x02,0x01,0x01,0x31,0x77,0x30,0x75,0x02,0x01,0x01,0x30,0x1a,
0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,
0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,0x30,0x0c,0x06,0x08,
0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x04,0x06,0x00,0x05,
0x00,0x04,0x40,0x81,0xa6,0x70,0xb3,0xef,0x59,0xd1,0x66,0xd1,0x9b,0xc0,0x9a,
0xb6,0x9a,0x5e,0x6d,0x6f,0x6d,0x0d,0x59,0xa9,0xaa,0x6e,0xe9,0x2c,0xa0,0x1e,
0xee,0xc2,0x60,0xbc,0x59,0xbe,0x3f,0x63,0x06,0x8d,0xc9,0x11,0x1d,0x23,0x64,
0x92,0xef,0x2e,0xfc,0x57,0x29,0xa4,0xaf,0xe0,0xee,0x93,0x19,0x39,0x51,0xe4,
0x44,0xb8,0x0b,0x28,0xf4,0xa8,0x0d }

Definition at line 438 of file message.c.

Referenced by test_verify_message_signature().

◆ v1CertWithValidPubKey

const BYTE v1CertWithValidPubKey[]
static
Initial value:
= {
0x30,0x81,0xcf,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30,
0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,
0x6e,0x67,0x00,0x30,0x22,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,
0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,
0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30,0x15,0x31,0x13,0x30,0x11,
0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,
0x67,0x00,0x30,0x5c,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x01,0x01,0x05,0x00,0x03,0x4b,0x00,0x30,0x48,0x02,0x41,0x00,0xe2,0x54,0x3a,
0xa7,0x83,0xb1,0x27,0x14,0x3e,0x59,0xbb,0xb4,0x53,0xe6,0x1f,0xe7,0x5d,0xf1,
0x21,0x68,0xad,0x85,0x53,0xdb,0x6b,0x1e,0xeb,0x65,0x97,0x03,0x86,0x60,0xde,
0xf3,0x6c,0x38,0x75,0xe0,0x4c,0x61,0xbb,0xbc,0x62,0x17,0xa9,0xcd,0x79,0x3f,
0x21,0x4e,0x96,0xcb,0x0e,0xdc,0x61,0x94,0x30,0x18,0x10,0x6b,0xd0,0x1c,0x10,
0x79,0x02,0x03,0x01,0x00,0x01,0xa3,0x16,0x30,0x14,0x30,0x12,0x06,0x03,0x55,
0x1d,0x13,0x01,0x01,0xff,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 }

Definition at line 296 of file message.c.

Referenced by msg_get_signer_callback().