forked from wolfSSL/wolfssl
macros for conditionally compiling code
This commit is contained in:
@ -1706,17 +1706,13 @@ void FreeCiphers(WOLFSSL* ssl)
|
||||
|
||||
void InitCipherSpecs(CipherSpecs* cs)
|
||||
{
|
||||
XMEMSET(cs, 0, sizeof(CipherSpecs));
|
||||
|
||||
cs->bulk_cipher_algorithm = INVALID_BYTE;
|
||||
cs->cipher_type = INVALID_BYTE;
|
||||
cs->mac_algorithm = INVALID_BYTE;
|
||||
cs->kea = INVALID_BYTE;
|
||||
cs->sig_algo = INVALID_BYTE;
|
||||
|
||||
cs->hash_size = 0;
|
||||
cs->static_ecdh = 0;
|
||||
cs->key_size = 0;
|
||||
cs->iv_size = 0;
|
||||
cs->block_size = 0;
|
||||
}
|
||||
|
||||
void InitSuitesHashSigAlgo(Suites* suites, int haveECDSAsig, int haveRSAsig,
|
||||
@ -1727,6 +1723,7 @@ void InitSuitesHashSigAlgo(Suites* suites, int haveECDSAsig, int haveRSAsig,
|
||||
(void)tls1_2;
|
||||
(void)keySz;
|
||||
|
||||
#if defined(HAVE_ECC) || defined(HAVE_ED25519)
|
||||
if (haveECDSAsig) {
|
||||
#ifdef WOLFSSL_SHA512
|
||||
suites->hashSigAlgo[idx++] = sha512_mac;
|
||||
@ -1750,6 +1747,7 @@ void InitSuitesHashSigAlgo(Suites* suites, int haveECDSAsig, int haveRSAsig,
|
||||
suites->hashSigAlgo[idx++] = ED25519_SA_MINOR;
|
||||
#endif
|
||||
}
|
||||
#endif /* HAVE_ECC || HAVE_ED25519 */
|
||||
|
||||
if (haveRSAsig) {
|
||||
#ifdef WC_RSA_PSS
|
||||
@ -1791,13 +1789,15 @@ void InitSuitesHashSigAlgo(Suites* suites, int haveECDSAsig, int haveRSAsig,
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_ANON
|
||||
if (haveAnon) {
|
||||
#ifdef HAVE_ANON
|
||||
suites->hashSigAlgo[idx++] = sha_mac;
|
||||
suites->hashSigAlgo[idx++] = anonymous_sa_algo;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
(void)haveAnon;
|
||||
(void)haveECDSAsig;
|
||||
suites->hashSigAlgoSz = (word16)idx;
|
||||
}
|
||||
|
||||
@ -1823,6 +1823,7 @@ void InitSuites(Suites* suites, ProtocolVersion pv, int keySz, word16 haveRSA,
|
||||
(void)haveNTRU;
|
||||
(void)haveStaticECC;
|
||||
(void)haveECC;
|
||||
(void)side;
|
||||
|
||||
if (suites == NULL) {
|
||||
WOLFSSL_MSG("InitSuites pointer error");
|
||||
@ -1832,6 +1833,7 @@ void InitSuites(Suites* suites, ProtocolVersion pv, int keySz, word16 haveRSA,
|
||||
if (suites->setSuites)
|
||||
return; /* trust user settings, don't override */
|
||||
|
||||
#ifndef NO_WOLFSSL_SERVER
|
||||
if (side == WOLFSSL_SERVER_END && haveStaticECC) {
|
||||
haveRSA = 0; /* can't do RSA with ECDSA key */
|
||||
(void)haveRSA; /* some builds won't read */
|
||||
@ -1841,6 +1843,7 @@ void InitSuites(Suites* suites, ProtocolVersion pv, int keySz, word16 haveRSA,
|
||||
haveRSAsig = 0; /* can't have RSA sig if signed by ECDSA */
|
||||
(void)haveRSAsig; /* non ecc builds won't read */
|
||||
}
|
||||
#endif /* !NO_WOLFSSL_SERVER */
|
||||
|
||||
#ifdef WOLFSSL_DTLS
|
||||
if (pv.major == DTLS_MAJOR) {
|
||||
@ -4441,10 +4444,12 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_WRITE_DUP
|
||||
if (writeDup) {
|
||||
/* all done */
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* hsHashes */
|
||||
ret = InitHandshakeHashes(ssl);
|
||||
|
@ -1534,19 +1534,23 @@ const byte* OidFromId(word32 id, word32 type, word32* oidSz)
|
||||
oid = extExtKeyUsageOid;
|
||||
*oidSz = sizeof(extExtKeyUsageOid);
|
||||
break;
|
||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
||||
case NAME_CONS_OID:
|
||||
oid = extNameConsOid;
|
||||
*oidSz = sizeof(extNameConsOid);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case oidCertAuthInfoType:
|
||||
switch (id) {
|
||||
#ifdef HAVE_OCSP
|
||||
case AIA_OCSP_OID:
|
||||
oid = extAuthInfoOcspOid;
|
||||
*oidSz = sizeof(extAuthInfoOcspOid);
|
||||
break;
|
||||
#endif
|
||||
case AIA_CA_ISSUER_OID:
|
||||
oid = extAuthInfoCaIssuerOid;
|
||||
*oidSz = sizeof(extAuthInfoCaIssuerOid);
|
||||
|
Reference in New Issue
Block a user