Merge pull request #2787 from dgarske/size_reduc

Adds options to disable the hash wrappers and base64 decode
This commit is contained in:
toddouska
2020-02-17 11:44:37 -08:00
committed by GitHub
3 changed files with 13 additions and 1 deletions

View File

@ -42,6 +42,8 @@ enum {
}; };
#ifdef WOLFSSL_BASE64_DECODE
static static
const byte base64Decode[] = { 62, BAD, BAD, BAD, 63, /* + starts at 0x2B */ const byte base64Decode[] = { 62, BAD, BAD, BAD, 63, /* + starts at 0x2B */
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
@ -144,6 +146,7 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
return 0; return 0;
} }
#endif /* WOLFSSL_BASE64_DECODE */
#if defined(WOLFSSL_BASE64_ENCODE) #if defined(WOLFSSL_BASE64_ENCODE)

View File

@ -58,6 +58,7 @@ enum Hash_Sum {
}; };
#endif /* !NO_ASN */ #endif /* !NO_ASN */
#if !defined(NO_PWDBASED) || !defined(NO_ASN)
/* function converts int hash type to enum */ /* function converts int hash type to enum */
enum wc_HashType wc_HashTypeConvert(int hashType) enum wc_HashType wc_HashTypeConvert(int hashType)
{ {
@ -126,6 +127,7 @@ enum wc_HashType wc_HashTypeConvert(int hashType)
#endif #endif
return eHashType; return eHashType;
} }
#endif /* !NO_PWDBASED || !NO_ASN */
#if !defined(NO_ASN) || !defined(NO_DH) || defined(HAVE_ECC) #if !defined(NO_ASN) || !defined(NO_DH) || defined(HAVE_ECC)
@ -264,7 +266,7 @@ enum wc_HashType wc_OidGetHash(int oid)
} }
#endif /* !NO_ASN || !NO_DH || HAVE_ECC */ #endif /* !NO_ASN || !NO_DH || HAVE_ECC */
#ifndef NO_HASH_WRAPPER
/* Get Hash digest size */ /* Get Hash digest size */
int wc_HashGetDigestSize(enum wc_HashType hash_type) int wc_HashGetDigestSize(enum wc_HashType hash_type)
@ -1362,6 +1364,8 @@ int wc_HashGetFlags(wc_HashAlg* hash, enum wc_HashType type, word32* flags)
#endif /* !WOLFSSL_NOSHA3_512 */ #endif /* !WOLFSSL_NOSHA3_512 */
#endif /* WOLFSSL_SHA3 */ #endif /* WOLFSSL_SHA3 */
#endif /* !NO_HASH_WRAPPER */
#ifdef WOLFSSL_HAVE_PRF #ifdef WOLFSSL_HAVE_PRF
#ifdef WOLFSSL_SHA384 #ifdef WOLFSSL_SHA384

View File

@ -2105,6 +2105,11 @@ extern void uITRON4_free(void *p) ;
#error TLS 1.3 requires the Signature Algorithms extension to be enabled #error TLS 1.3 requires the Signature Algorithms extension to be enabled
#endif #endif
#ifndef NO_WOLFSSL_BASE64_DECODE
#define WOLFSSL_BASE64_DECODE
#endif
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif