forked from aws/aws-lc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mldsa-test-suite' of github.com:jakemas/aws-lc into mld…
…sa-test-suite
- Loading branch information
Showing
1,191 changed files
with
1,852 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
#include <cstdint> | ||
|
||
#include <openssl/bio.h> | ||
#include <openssl/err.h> | ||
#include <openssl/pkcs7.h> | ||
#include <openssl/rsa.h> | ||
#include <openssl/x509.h> | ||
#include <openssl/pem.h> | ||
|
||
// The corpus was created using the following key. | ||
// If you change the key, the corpus should be augmented with inputs | ||
// created using (or "seeded" from) PKCS7 values encrypted with | ||
// the new key. | ||
static const char kKey[] = R"( | ||
-----BEGIN PRIVATE KEY----- | ||
MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQC1+MOn+BopcEVR | ||
4QMvjXdAxGkWFllXyQFDToL+qOiPRU1yN7C8KCtkbOAFttJIO4O/i0iZ7KqYbnmB | ||
6YUA/ONAcakocnrdoESgRJcVMeAxDk/11OtMF5yIfeOOO/TUeVNmAUaT63gFbKy/ | ||
adpqhzJtOv9BBl5VcYNGGSE+0wtbmjpmNsxunEQR1KLDc97fGYHeRfKoSyrCIEE8 | ||
IaAEpKGR2Sku3v9Jwh7RpjupgiUAkH6pJk7VMZm5vl2wFjYvfysgjeN5ZtsxFDMa | ||
PYZStpxMxpNd5C9DsO2Ljp5NMpGfNGmG4ZqiaQg8z2cIM6ESmN1zDJdUh5IXed1f | ||
OxBZD/poUFH0wDRFWnvzlaPmjJEFrYLMK8svnE5nEQp9vu93ISFBx7cofs+niMaU | ||
XPEqaRSqruifN2M1it3kOf/8YZl1vurs+VtHD6nOJo6bd11+37aBidIB/BaWnzLr | ||
DmSTcPFa1tkTHwoLqc9+jThTq9jZ6w3lAMPpsoenyD19UmQB589+4kNp2SIO/Ttz | ||
VQCGgQPXE2jDCl6G9aIPMkfvpPZK4THVil3WQRCFYnYdDO4HQXo2ZuC4RiqgY5yg | ||
feoL+fa9k383lgxxAHQLS7xsbaVB40RmfdbdevgPYIwZNNO78ddRmMdSv6IknSW9 | ||
gydGzY//btY+t1SWcBZWzn1Ewq8g2QIDAQABAoICAFQ/liZAIaypxA5ChP0RG/Mq | ||
fBSzyC1ybFlDEjbg8LrUNST6T6LtXhmipp0+pWC33SljTPumrNzh2POir+djLbt6 | ||
Y/zL88KEHwGsf95aNxe/Lpn8N+wEyn4O+rmxXIq6mTgSwyBc1jZ8uAXu9iZ37YrQ | ||
07jBQA+C/GoJ3HB/uTRx1TPZ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Sm0f20Vc06oS | ||
sQF5Ji4LSyf6t9oQKePjFIGoIc6pf6BXJZYP4rBnzQzUQjH2yzDYDY3TuV7bFJJU | ||
DcSTGM6nP0fRMmgBtB14o7A6Gsy6X/N2ElgbvWT8YhmUC6H8DIzmZwHRKaG6C6g5 | ||
eEjuAYenYNM4jxeteC1neUDIdGxH/BA7JrAqcGaN9GT+R47YIfiS2WrEssD1Pi5h | ||
hJTbHtjEDJ7BHLC/CNUhXbpyyu1y | ||
-----END PRIVATE KEY----- | ||
)"; | ||
|
||
static const char kCert[] = R"( | ||
-----BEGIN CERTIFICATE----- | ||
MIIEqzCCApOgAwIBAgIBADANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 | ||
MCAXDTcwMDEwMTAwMDAwMFoYDzk5OTkxMjMxMjM1OTU5WjAPMQ0wCwYDVQQDDARM | ||
ZWFmMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtfjDp/gaKXBFUeED | ||
L413QMRpFhZZV8kBQ06C/qjoj0VNcjewvCgrZGzgBbbSSDuDv4tImeyqmG55gemF | ||
APzjQHGpKHJ63aBEoESXFTHgMQ5P9dTrTBeciH3jjjv01HlTZgFGk+t4BWysv2na | ||
aocybTr/QQZeVXGDRhkhPtMLW5o6ZjbMbpxEEdSiw3Pe3xmB3kXyqEsqwiBBPCGg | ||
BKShkdkpLt7/ScIe0aY7qYIlAJB+qSZO1TGZub5dsBY2L38rII3jeWbbMRQzGj2G | ||
UracTMaTXeQvQ7Dti46eTTKRnzRphuGaomkIPM9nCDOhEpjdcwyXVIeSF3ndXzsQ | ||
WQ/6aFBR9MA0RVp785Wj5oyRBa2CzCvLL5xOZxEKfb7vdyEhQce3KH7Pp4jGlFzx | ||
KmkUqq7onzdjNYrd5Dn//GGZdb7q7PlbRw+pziaOm3ddft+2gYnSAfwWlp8y6w5k | ||
k3DxWtbZEx8KC6nPfo04U6vY2esN5QDD6bKHp8g9fVJkAefPfuJDadkiDv07c1UA | ||
hoED1xNowwpehvWiDzJH76T2SuEx1Ypd1kEQhWJ2HQzuB0F6NmbguEYqoGOcoH3q | ||
C/n2vZN/N5YMcQB0C0u8bG2lQeNEZn3W3Xr4D2CMGTTTu/HXUZjHUr+iJJ0lvYMn | ||
Rs2P/27WPrdUlnAWVs59RMKvINkCAwEAAaMQMA4wDAYDVR0TAQH/BAIwADANBgkq | ||
hkiG9w0BAQsFAAOCAgEAMZR8p6FGActr5RNICECEKnp6qfgaZiQFwKg64uovggh3 | ||
PU4VhRGWtNAD4E8/G37I1WjEJwSh6YrthQJrSmfnVxUgXwZqW3Ou5UJpaWwReEMV | ||
xXwznJTwoUwD9pzh/+2QeNYV+6CPmGPD8znhh9QzOoo1mIaUNdDGN7K6dVBBBr7O | ||
Dm67qWXf8AoWLUO5XTiha5V19Jsyxszo2Ntfef9mK4LIszuRbMrpfMlUEvuO3oLa | ||
SLScdPonEPF7CGuyJcyVVJ4T+mqTzmQ9AKzujjXk3sqw5rFbPIC+ei5Fdf0SXsgS | ||
jEX83uZPZRIMjkyiVjDsWwDDumaTJ/KCUhaqGzJ6/ZKLEvKCgtgDQg2QetmRzS5j | ||
c9CC6I6Kfx01cJ6wOlJY22DDjWJAviEP40/TVk1xoEWyiErEiYq3vdCRRoxSR55N | ||
/tjiQM0XbiGfKfx2KrAHFIsRQsqHF0bL4HDjCh29cz3jleWdLGNPwrdfLtPMcXf8 | ||
Eu6/5vlz8BUuaR08fjv59tfdedLDRlbpZFERMio6PINFoRuVtbcgVw5xHucHjl3p | ||
shp0eY7uylv5j8j1X7m5fp+BZKILGHLKVrE2ihJgyS9je2Jf40Fb+Hu+1dcsAKd+ | ||
jbgtnMeOs3SWELGeAG2TXsKmNOb0OwzGeL5jJpe6tsEUiQQQxhfarBIlxoTPizI= | ||
-----END CERTIFICATE----- | ||
)"; | ||
|
||
class SharedData { | ||
public: | ||
EVP_PKEY *key = nullptr; | ||
X509 *cert = nullptr; | ||
|
||
SharedData() { | ||
{ | ||
BIO *key_bio = BIO_new_mem_buf(const_cast<char *>(kKey), sizeof(kKey) - 1); | ||
key = PEM_read_bio_PrivateKey(key_bio, nullptr, nullptr, nullptr); | ||
BIO_free(key_bio); | ||
} | ||
{ | ||
BIO *cert_bio = BIO_new_mem_buf(const_cast<char *>(kCert), sizeof(kCert) - 1); | ||
cert = PEM_read_bio_X509(cert_bio, nullptr, nullptr, nullptr); | ||
BIO_free(cert_bio); | ||
} | ||
} | ||
|
||
~SharedData() { | ||
X509_free(cert); | ||
EVP_PKEY_free(key); | ||
} | ||
}; | ||
|
||
static SharedData sharedData; | ||
|
||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) { | ||
PKCS7 *pkcs7 = nullptr; | ||
|
||
pkcs7 = d2i_PKCS7(nullptr, &buf, len); | ||
if (pkcs7 == nullptr) { | ||
goto end; | ||
} | ||
|
||
{ | ||
BIO *data_bio = BIO_new(BIO_s_mem()); | ||
OPENSSL_BEGIN_ALLOW_DEPRECATED | ||
PKCS7_decrypt(pkcs7, sharedData.key, NULL, data_bio, 0); | ||
OPENSSL_END_ALLOW_DEPRECATED | ||
BIO_free(data_bio); | ||
} | ||
|
||
{ | ||
BIO *data_bio = BIO_new(BIO_s_mem()); | ||
OPENSSL_BEGIN_ALLOW_DEPRECATED | ||
PKCS7_decrypt(pkcs7, sharedData.key, sharedData.cert, data_bio, 0); | ||
OPENSSL_END_ALLOW_DEPRECATED | ||
BIO_free(data_bio); | ||
} | ||
|
||
end: | ||
PKCS7_free(pkcs7); | ||
|
||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/009fee48340637584f5a0138f23edab9f2b3da9c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2� |
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/0232d6504fe16172b86cacaa0ebb822cf0c22fda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
>� |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/0700cedb2ad4f2800ea33955945909419aed29db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
>S |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/0eb5037935ba1c2791f3b7e9bc8470c3c60d2aff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0� |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/1150a9e4dc381f752e9b88801821bf678212b2a5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0�0 | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/217f2e451d7c8557679b980ff14426c86eb8713a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
;� |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/3f5a49cbdcbf901134146e1b6f89aafbb6e578c5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/40e89aec926a5d4cc19463466efcb3c1debf42ee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$� |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/pkcs7_decrypt_corpus/4ddcee224585ac659b9efdc83f2291f3193c154c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0�0�0� |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.