mirror of https://github.com/wolfSSL/wolfssl.git
commit
18b78795fb
|
@ -629,7 +629,6 @@ int GetShortInt(const byte* input, word32* inOutIdx, int* number, word32 maxIdx)
|
||||||
}
|
}
|
||||||
#endif /* !NO_PWDBASED */
|
#endif /* !NO_PWDBASED */
|
||||||
|
|
||||||
#ifndef NO_ASN_TIME
|
|
||||||
/* May not have one, not an error */
|
/* May not have one, not an error */
|
||||||
static int GetExplicitVersion(const byte* input, word32* inOutIdx, int* version,
|
static int GetExplicitVersion(const byte* input, word32* inOutIdx, int* version,
|
||||||
word32 maxIdx)
|
word32 maxIdx)
|
||||||
|
@ -647,7 +646,6 @@ static int GetExplicitVersion(const byte* input, word32* inOutIdx, int* version,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* !NO_ASN_TIME */
|
|
||||||
|
|
||||||
int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
|
int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
|
||||||
word32 maxIdx)
|
word32 maxIdx)
|
||||||
|
@ -2658,7 +2656,6 @@ void FreeDecodedCert(DecodedCert* cert)
|
||||||
#endif /* OPENSSL_EXTRA */
|
#endif /* OPENSSL_EXTRA */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_ASN_TIME
|
|
||||||
static int GetCertHeader(DecodedCert* cert)
|
static int GetCertHeader(DecodedCert* cert)
|
||||||
{
|
{
|
||||||
int ret = 0, len;
|
int ret = 0, len;
|
||||||
|
@ -2705,9 +2702,7 @@ static int StoreRsaKey(DecodedCert* cert)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* !NO_RSA */
|
||||||
#endif /* !NO_ASN_TIME */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
|
|
||||||
|
@ -2728,7 +2723,6 @@ static int StoreRsaKey(DecodedCert* cert)
|
||||||
|
|
||||||
#endif /* HAVE_ECC */
|
#endif /* HAVE_ECC */
|
||||||
|
|
||||||
#ifndef NO_ASN_TIME
|
|
||||||
static int GetKey(DecodedCert* cert)
|
static int GetKey(DecodedCert* cert)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
@ -2869,7 +2863,6 @@ static int GetKey(DecodedCert* cert)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* process NAME, either issuer or subject */
|
/* process NAME, either issuer or subject */
|
||||||
static int GetName(DecodedCert* cert, int nameType)
|
static int GetName(DecodedCert* cert, int nameType)
|
||||||
{
|
{
|
||||||
|
@ -3349,6 +3342,7 @@ static int GetName(DecodedCert* cert, int nameType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NO_ASN_TIME
|
||||||
#if !defined(NO_TIME_H) && defined(USE_WOLF_VALIDDATE)
|
#if !defined(NO_TIME_H) && defined(USE_WOLF_VALIDDATE)
|
||||||
|
|
||||||
/* to the second */
|
/* to the second */
|
||||||
|
@ -3430,7 +3424,7 @@ int GetTimeString(byte* date, int format, char* buf, int len)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* MYSQL compatibility */
|
#endif /* WOLFSSL_MYSQL_COMPATIBLE */
|
||||||
|
|
||||||
int ExtractDate(const unsigned char* date, unsigned char format,
|
int ExtractDate(const unsigned char* date, unsigned char format,
|
||||||
struct tm* certTime, int* idx)
|
struct tm* certTime, int* idx)
|
||||||
|
@ -3534,6 +3528,8 @@ int wc_GetTime(void* timePtr, word32 timeSize)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* !NO_ASN_TIME */
|
||||||
|
|
||||||
static int GetDate(DecodedCert* cert, int dateType)
|
static int GetDate(DecodedCert* cert, int dateType)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
@ -3542,6 +3538,7 @@ static int GetDate(DecodedCert* cert, int dateType)
|
||||||
word32 startIdx = 0;
|
word32 startIdx = 0;
|
||||||
|
|
||||||
XMEMSET(date, 0, MAX_DATE_SIZE);
|
XMEMSET(date, 0, MAX_DATE_SIZE);
|
||||||
|
|
||||||
if (dateType == BEFORE)
|
if (dateType == BEFORE)
|
||||||
cert->beforeDate = &cert->source[cert->srcIdx];
|
cert->beforeDate = &cert->source[cert->srcIdx];
|
||||||
else
|
else
|
||||||
|
@ -3566,17 +3563,18 @@ static int GetDate(DecodedCert* cert, int dateType)
|
||||||
else
|
else
|
||||||
cert->afterDateLen = cert->srcIdx - startIdx;
|
cert->afterDateLen = cert->srcIdx - startIdx;
|
||||||
|
|
||||||
|
#ifndef NO_ASN_TIME
|
||||||
if (!XVALIDATE_DATE(date, b, dateType)) {
|
if (!XVALIDATE_DATE(date, b, dateType)) {
|
||||||
if (dateType == BEFORE)
|
if (dateType == BEFORE)
|
||||||
return ASN_BEFORE_DATE_E;
|
return ASN_BEFORE_DATE_E;
|
||||||
else
|
else
|
||||||
return ASN_AFTER_DATE_E;
|
return ASN_AFTER_DATE_E;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int GetValidity(DecodedCert* cert, int verify)
|
static int GetValidity(DecodedCert* cert, int verify)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
@ -3636,7 +3634,6 @@ int DecodeToKey(DecodedCert* cert, int verify)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int GetSignature(DecodedCert* cert)
|
static int GetSignature(DecodedCert* cert)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
@ -3660,7 +3657,6 @@ static int GetSignature(DecodedCert* cert)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* !NO_ASN_TIME */
|
|
||||||
|
|
||||||
static word32 SetDigest(const byte* digest, word32 digSz, byte* output)
|
static word32 SetDigest(const byte* digest, word32 digSz, byte* output)
|
||||||
{
|
{
|
||||||
|
@ -3883,7 +3879,6 @@ int wc_GetCTC_HashOID(int type)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_ASN_TIME
|
|
||||||
/* return true (1) or false (0) for Confirmation */
|
/* return true (1) or false (0) for Confirmation */
|
||||||
static int ConfirmSignature(const byte* buf, word32 bufSz,
|
static int ConfirmSignature(const byte* buf, word32 bufSz,
|
||||||
const byte* key, word32 keySz, word32 keyOID,
|
const byte* key, word32 keySz, word32 keyOID,
|
||||||
|
@ -4325,7 +4320,6 @@ static int ConfirmNameConstraints(Signer* signer, DecodedCert* cert)
|
||||||
|
|
||||||
#endif /* IGNORE_NAME_CONSTRAINTS */
|
#endif /* IGNORE_NAME_CONSTRAINTS */
|
||||||
|
|
||||||
|
|
||||||
static int DecodeAltNames(byte* input, int sz, DecodedCert* cert)
|
static int DecodeAltNames(byte* input, int sz, DecodedCert* cert)
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
|
@ -4519,7 +4513,6 @@ static int DecodeAltNames(byte* input, int sz, DecodedCert* cert)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int DecodeBasicCaConstraint(byte* input, int sz, DecodedCert* cert)
|
static int DecodeBasicCaConstraint(byte* input, int sz, DecodedCert* cert)
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
|
@ -4951,7 +4944,6 @@ static int DecodeNameConstraints(byte* input, int sz, DecodedCert* cert)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* IGNORE_NAME_CONSTRAINTS */
|
#endif /* IGNORE_NAME_CONSTRAINTS */
|
||||||
#endif /* NO_ASN_TIME */
|
|
||||||
|
|
||||||
#if defined(WOLFSSL_CERT_EXT) && !defined(WOLFSSL_SEP)
|
#if defined(WOLFSSL_CERT_EXT) && !defined(WOLFSSL_SEP)
|
||||||
|
|
||||||
|
@ -5121,7 +5113,6 @@ static int DecodePolicyOID(char *out, word32 outSz, byte *in, word32 inSz)
|
||||||
}
|
}
|
||||||
#endif /* WOLFSSL_SEP */
|
#endif /* WOLFSSL_SEP */
|
||||||
|
|
||||||
#ifndef NO_ASN_TIME
|
|
||||||
static int DecodeCertExtensions(DecodedCert* cert)
|
static int DecodeCertExtensions(DecodedCert* cert)
|
||||||
/*
|
/*
|
||||||
* Processing the Certificate Extensions. This does not modify the current
|
* Processing the Certificate Extensions. This does not modify the current
|
||||||
|
@ -5312,7 +5303,6 @@ static int DecodeCertExtensions(DecodedCert* cert)
|
||||||
return criticalFail ? ASN_CRIT_EXT_E : 0;
|
return criticalFail ? ASN_CRIT_EXT_E : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ParseCert(DecodedCert* cert, int type, int verify, void* cm)
|
int ParseCert(DecodedCert* cert, int type, int verify, void* cm)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -5346,8 +5336,6 @@ int ParseCert(DecodedCert* cert, int type, int verify, void* cm)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* !NO_ASN_TIME */
|
|
||||||
|
|
||||||
|
|
||||||
/* from SSL proper, for locking can't do find here anymore */
|
/* from SSL proper, for locking can't do find here anymore */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -5383,7 +5371,6 @@ Signer* GetCAByName(void* signers, byte* hash)
|
||||||
|
|
||||||
#endif /* WOLFCRYPT_ONLY || NO_CERTS */
|
#endif /* WOLFCRYPT_ONLY || NO_CERTS */
|
||||||
|
|
||||||
#ifndef NO_ASN_TIME
|
|
||||||
int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
|
int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
|
||||||
{
|
{
|
||||||
word32 confirmOID;
|
word32 confirmOID;
|
||||||
|
@ -5524,7 +5511,6 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* !NO_ASN_TIME */
|
|
||||||
|
|
||||||
/* Create and init an new signer */
|
/* Create and init an new signer */
|
||||||
Signer* MakeSigner(void* heap)
|
Signer* MakeSigner(void* heap)
|
||||||
|
|
Loading…
Reference in New Issue