-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fuzz-der-cert driver with dictionary and corpus
Dictionary extracted from ASN1 constants. Corpus extracted from unit tests. NOTE: Corpus is *not* yet minimized.
- Loading branch information
Showing
70 changed files
with
66 additions
and
0 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
Binary file added
BIN
+451 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Cert_Version_V2_Cert_DER
Binary file not shown.
Binary file added
BIN
+450 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Ext_AKID_Length_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+450 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Ext_Basic_CA_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+447 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Ext_Basic_Critical_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+448 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Ext_Basic_Critical_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+448 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Ext_KeyUsage_Critical_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+448 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Ext_KeyUsage_Critical_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+449 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Ext_SKID_Length_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+678 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Oversized_Cert_DER
Binary file not shown.
Binary file added
BIN
+448 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Sig_Algo_ECDSA_With_SHA1_Cert_DER
Binary file not shown.
Binary file added
BIN
+448 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Sig_Curve_Secp256k1_Cert_DER
Binary file not shown.
Binary file added
BIN
+477 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Subject_CAT_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+451 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Subject_FabricId_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+439 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Validity_Not_After_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+439 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Validity_Not_Before_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+451 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_ICAC_Validity_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+519 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Cert_Version_V2_Cert_DER
Binary file not shown.
Binary file added
BIN
+516 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Ext_AKID_Length_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+522 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Ext_Basic_CA_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+513 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Ext_Basic_Critical_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+513 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Ext_Basic_Critical_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+520 Bytes
...rations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Ext_Basic_PathLen_Presence_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+512 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Ext_KeyUsage_Critical_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+513 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Ext_KeyUsage_Critical_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+515 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Ext_SKID_Length_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+744 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Oversized_Cert_DER
Binary file not shown.
Binary file added
BIN
+517 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Sig_Algo_ECDSA_With_SHA1_Cert_DER
Binary file not shown.
Binary file added
BIN
+515 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Sig_Curve_Secp256k1_Cert_DER
Binary file not shown.
Binary file added
BIN
+544 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Subject_CAT_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+518 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Subject_FabricId_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+517 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Subject_NodeId_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+506 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Validity_Not_After_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+505 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Validity_Not_Before_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+519 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_NOC_Validity_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+416 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Cert_Version_V2_Cert_DER
Binary file not shown.
Binary file added
BIN
+415 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Ext_AKID_Length_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+417 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Ext_Basic_CA_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+414 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Ext_Basic_Critical_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+414 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Ext_Basic_Critical_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+414 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Ext_KeyUsage_Critical_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+414 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Ext_KeyUsage_Critical_Wrong_Cert_DER
Binary file not shown.
Binary file added
BIN
+414 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+871 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Oversized_Cert_DER
Binary file not shown.
Binary file added
BIN
+414 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Sig_Algo_ECDSA_With_SHA1_Cert_DER
Binary file not shown.
Binary file added
BIN
+414 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Sig_Curve_Secp256k1_Cert_DER
Binary file not shown.
Binary file added
BIN
+470 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Subject_CAT_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+416 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Subject_FabricId_Invalid_Cert_DER
Binary file not shown.
Binary file added
BIN
+403 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Validity_Not_After_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+404 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Validity_Not_Before_Missing_Cert_DER
Binary file not shown.
Binary file added
BIN
+417 Bytes
integrations/fuzz/fuzz-der-cert-corpus/sChipTest_RCAC_Validity_Wrong_Cert_DER
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.
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,36 @@ | ||
# ASN1 constants extracted from src/lib/asn1/ASN1.h | ||
|
||
# ASN1TagClasses | ||
kASN1TagClass_Universal = "\x00" | ||
kASN1TagClass_Application = "\x40" | ||
kASN1TagClass_ContextSpecific = "\x80" | ||
kASN1TagClass_Private = "\xC0" | ||
|
||
# ASN1UniversalTags | ||
kASN1UniversalTag_Boolean = "\x01" | ||
kASN1UniversalTag_Integer = "\x02" | ||
kASN1UniversalTag_BitString = "\x03" | ||
kASN1UniversalTag_OctetString = "\x04" | ||
kASN1UniversalTag_Null = "\x05" | ||
kASN1UniversalTag_ObjectId = "\x06" | ||
kASN1UniversalTag_ObjectDesc = "\x07" | ||
kASN1UniversalTag_External = "\x08" | ||
kASN1UniversalTag_Real = "\x09" | ||
kASN1UniversalTag_Enumerated = "\x0A" | ||
kASN1UniversalTag_UTF8String = "\x0C" | ||
kASN1UniversalTag_Sequence = "\x10" | ||
kASN1UniversalTag_Set = "\x11" | ||
kASN1UniversalTag_NumericString = "\x12" | ||
kASN1UniversalTag_PrintableString = "\x13" | ||
kASN1UniversalTag_T61String = "\x14" | ||
kASN1UniversalTag_VideotexString = "\x15" | ||
kASN1UniversalTag_IA5String = "\x16" | ||
kASN1UniversalTag_UTCTime = "\x17" | ||
kASN1UniversalTag_GeneralizedTime = "\x18" | ||
kASN1UniversalTag_GraphicString = "\x19" | ||
kASN1UniversalTag_VisibleString = "\x1A" | ||
kASN1UniversalTag_GeneralString = "\x1B" | ||
kASN1UniversalTag_UniversalString = "\x1C" | ||
|
||
kASN1UniversalTag_Sequence_Constructed = "\x30" | ||
kASN1UniversalTag_Set_Constructed = "\x31" |
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,25 @@ | ||
#include <cstddef> | ||
#include <cstdint> | ||
|
||
#include "credentials/CHIPCert.h" | ||
|
||
using namespace chip; | ||
using namespace chip::Credentials; | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t * data, size_t len) | ||
{ | ||
ByteSpan span(data, len); | ||
|
||
{ | ||
ChipDN dn; | ||
(void) ExtractSubjectDNFromX509Cert(span, dn); | ||
} | ||
|
||
{ | ||
uint8_t outCertBuf[kMaxCHIPCertLength]; | ||
MutableByteSpan outCert(outCertBuf); | ||
(void) ConvertX509CertToChipCert(span, outCert); | ||
} | ||
|
||
return 0; | ||
} |