forked from wolfSSL/wolfssl
Added wolfCrypt test example for setting a custom serial number. Changed CTC_SERIAL_SIZE to 16 (more common max).
This commit is contained in:
@ -8201,6 +8201,7 @@ int rsa_test(void)
|
|||||||
/* self signed */
|
/* self signed */
|
||||||
{
|
{
|
||||||
Cert myCert;
|
Cert myCert;
|
||||||
|
const byte mySerial[8] = {1,2,3,4,5,6,7,8};
|
||||||
#if !defined(NO_FILESYSTEM) && !defined(NO_WRITE_TEMP_FILES)
|
#if !defined(NO_FILESYSTEM) && !defined(NO_WRITE_TEMP_FILES)
|
||||||
FILE* derFile;
|
FILE* derFile;
|
||||||
FILE* pemFile;
|
FILE* pemFile;
|
||||||
@ -8231,6 +8232,8 @@ int rsa_test(void)
|
|||||||
XSTRNCPY(myCert.subject.unit, "Development", CTC_NAME_SIZE);
|
XSTRNCPY(myCert.subject.unit, "Development", CTC_NAME_SIZE);
|
||||||
XSTRNCPY(myCert.subject.commonName, "www.yassl.com", CTC_NAME_SIZE);
|
XSTRNCPY(myCert.subject.commonName, "www.yassl.com", CTC_NAME_SIZE);
|
||||||
XSTRNCPY(myCert.subject.email, "info@yassl.com", CTC_NAME_SIZE);
|
XSTRNCPY(myCert.subject.email, "info@yassl.com", CTC_NAME_SIZE);
|
||||||
|
XMEMCPY(myCert.serial, mySerial, sizeof(mySerial));
|
||||||
|
myCert.serialSz = (int)sizeof(mySerial);
|
||||||
myCert.isCA = 1;
|
myCert.isCA = 1;
|
||||||
myCert.sigType = CTC_SHA256wRSA;
|
myCert.sigType = CTC_SHA256wRSA;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ enum Ctc_Misc {
|
|||||||
CTC_NAME_SIZE = 64,
|
CTC_NAME_SIZE = 64,
|
||||||
CTC_DATE_SIZE = 32,
|
CTC_DATE_SIZE = 32,
|
||||||
CTC_MAX_ALT_SIZE = 16384, /* may be huge */
|
CTC_MAX_ALT_SIZE = 16384, /* may be huge */
|
||||||
CTC_SERIAL_SIZE = 20,
|
CTC_SERIAL_SIZE = 16,
|
||||||
#ifdef WOLFSSL_CERT_EXT
|
#ifdef WOLFSSL_CERT_EXT
|
||||||
/* AKID could contains: hash + (Option) AuthCertIssuer,AuthCertSerialNum
|
/* AKID could contains: hash + (Option) AuthCertIssuer,AuthCertSerialNum
|
||||||
* We support only hash */
|
* We support only hash */
|
||||||
|
Reference in New Issue
Block a user