add overried for max entries and certificate generation size

This commit is contained in:
Jacob Barthelmeh
2020-08-26 19:22:57 -06:00
parent bc58dde700
commit ab52bcf43d
2 changed files with 13 additions and 2 deletions

View File

@@ -37743,12 +37743,18 @@ static int CopyX509NameToCertName(WOLFSSL_X509_NAME* n, CertName* cName)
return ret;
}
#ifndef WC_MAX_X509_GEN
/* able to override max size until dynamic buffer created */
#define WC_MAX_X509_GEN 4096
#endif
/* returns the size of signature on success */
int wolfSSL_X509_sign(WOLFSSL_X509* x509, WOLFSSL_EVP_PKEY* pkey,
const WOLFSSL_EVP_MD* md)
{
int ret;
byte der[4096]; /* @TODO dynamic set based on expected cert size */
byte der[WC_MAX_X509_GEN]; /* @TODO dynamic based on expected cert size */
int derSz = sizeof(der);
WOLFSSL_ENTER("wolfSSL_X509_sign");

View File

@@ -366,7 +366,6 @@ enum Misc_ASN {
MAX_CERTPOL_SZ = CTC_MAX_CERTPOL_SZ,
#endif
MAX_AIA_SZ = 2, /* Max Authority Info Access extension size*/
MAX_NAME_ENTRIES = 13, /* entries added to x509 name struct */
OCSP_NONCE_EXT_SZ = 35, /* OCSP Nonce Extension size */
MAX_OCSP_EXT_SZ = 58, /* Max OCSP Extension length */
MAX_OCSP_NONCE_SZ = 16, /* OCSP Nonce size */
@@ -395,6 +394,12 @@ enum Misc_ASN {
PEM_LINE_LEN = PEM_LINE_SZ + 12, /* PEM line max + fudge */
};
#ifndef WC_MAX_NAME_ENTRIES
/* entries added to x509 name struct */
#define WC_MAX_NAME_ENTRIES 13
#endif
#define MAX_NAME_ENTRIES WC_MAX_NAME_ENTRIES
enum Oid_Types {
oidHashType = 0,