mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Advertise all supported sigalgs by default
This commit is contained in:
@ -3209,22 +3209,6 @@ void InitSuites(Suites* suites, ProtocolVersion pv, int keySz, word16 haveRSA,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(void)tls; /* shut up compiler */
|
|
||||||
(void)tls1_2;
|
|
||||||
(void)dtls;
|
|
||||||
(void)haveDH;
|
|
||||||
(void)havePSK;
|
|
||||||
(void)haveStaticRSA;
|
|
||||||
(void)haveStaticECC;
|
|
||||||
(void)haveECC;
|
|
||||||
(void)side;
|
|
||||||
(void)haveRSA; /* some builds won't read */
|
|
||||||
(void)haveRSAsig; /* non ecc builds won't read */
|
|
||||||
(void)haveAnon; /* anon ciphers optional */
|
|
||||||
(void)haveNull;
|
|
||||||
(void)haveFalconSig;
|
|
||||||
(void)haveDilithiumSig;
|
|
||||||
|
|
||||||
if (suites == NULL) {
|
if (suites == NULL) {
|
||||||
WOLFSSL_MSG("InitSuites pointer error");
|
WOLFSSL_MSG("InitSuites pointer error");
|
||||||
return;
|
return;
|
||||||
@ -4241,18 +4225,27 @@ void InitSuites(Suites* suites, ProtocolVersion pv, int keySz, word16 haveRSA,
|
|||||||
suites->suiteSz = idx;
|
suites->suiteSz = idx;
|
||||||
|
|
||||||
if (suites->hashSigAlgoSz == 0) {
|
if (suites->hashSigAlgoSz == 0) {
|
||||||
int haveSig = 0;
|
InitSuitesHashSigAlgo(suites->hashSigAlgo, SIG_ALL, tls1_2, keySz,
|
||||||
haveSig |= (haveRSAsig | haveRSA) ? SIG_RSA : 0;
|
|
||||||
haveSig |= (haveECDSAsig | haveECC) ? SIG_ECDSA : 0;
|
|
||||||
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
|
|
||||||
haveSig |= (haveECDSAsig | haveECC) ? SIG_SM2 : 0;
|
|
||||||
#endif
|
|
||||||
haveSig |= haveFalconSig ? SIG_FALCON : 0;
|
|
||||||
haveSig |= haveDilithiumSig ? SIG_DILITHIUM : 0;
|
|
||||||
haveSig &= ~SIG_ANON;
|
|
||||||
InitSuitesHashSigAlgo(suites->hashSigAlgo, haveSig, tls1_2, keySz,
|
|
||||||
&suites->hashSigAlgoSz);
|
&suites->hashSigAlgoSz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Moved to the end as we set some of the vars but never use them */
|
||||||
|
(void)tls; /* shut up compiler */
|
||||||
|
(void)tls1_2;
|
||||||
|
(void)dtls;
|
||||||
|
(void)haveDH;
|
||||||
|
(void)havePSK;
|
||||||
|
(void)haveStaticRSA;
|
||||||
|
(void)haveStaticECC;
|
||||||
|
(void)haveECC;
|
||||||
|
(void)haveECDSAsig;
|
||||||
|
(void)side;
|
||||||
|
(void)haveRSA; /* some builds won't read */
|
||||||
|
(void)haveRSAsig; /* non ecc builds won't read */
|
||||||
|
(void)haveAnon; /* anon ciphers optional */
|
||||||
|
(void)haveNull;
|
||||||
|
(void)haveFalconSig;
|
||||||
|
(void)haveDilithiumSig;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(NO_WOLFSSL_SERVER) || !defined(NO_CERTS) || \
|
#if !defined(NO_WOLFSSL_SERVER) || !defined(NO_CERTS) || \
|
||||||
|
@ -7633,10 +7633,6 @@ static int SendTls13CertificateRequest(WOLFSSL* ssl, byte* reqCtx,
|
|||||||
word32 reqSz;
|
word32 reqSz;
|
||||||
word16 hashSigAlgoSz = 0;
|
word16 hashSigAlgoSz = 0;
|
||||||
SignatureAlgorithms* sa;
|
SignatureAlgorithms* sa;
|
||||||
int haveSig = SIG_RSA | SIG_ECDSA | SIG_FALCON | SIG_DILITHIUM;
|
|
||||||
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
|
|
||||||
haveSig |= SIG_SM2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WOLFSSL_START(WC_FUNC_CERTIFICATE_REQUEST_SEND);
|
WOLFSSL_START(WC_FUNC_CERTIFICATE_REQUEST_SEND);
|
||||||
WOLFSSL_ENTER("SendTls13CertificateRequest");
|
WOLFSSL_ENTER("SendTls13CertificateRequest");
|
||||||
@ -7647,12 +7643,12 @@ static int SendTls13CertificateRequest(WOLFSSL* ssl, byte* reqCtx,
|
|||||||
return SIDE_ERROR;
|
return SIDE_ERROR;
|
||||||
|
|
||||||
/* Get the length of the hashSigAlgo buffer */
|
/* Get the length of the hashSigAlgo buffer */
|
||||||
InitSuitesHashSigAlgo(NULL, haveSig, 1, ssl->buffers.keySz,
|
InitSuitesHashSigAlgo(NULL, SIG_ALL, 1, ssl->buffers.keySz,
|
||||||
&hashSigAlgoSz);
|
&hashSigAlgoSz);
|
||||||
sa = TLSX_SignatureAlgorithms_New(ssl, hashSigAlgoSz, ssl->heap);
|
sa = TLSX_SignatureAlgorithms_New(ssl, hashSigAlgoSz, ssl->heap);
|
||||||
if (sa == NULL)
|
if (sa == NULL)
|
||||||
return MEMORY_ERROR;
|
return MEMORY_ERROR;
|
||||||
InitSuitesHashSigAlgo(sa->hashSigAlgo, haveSig, 1, ssl->buffers.keySz,
|
InitSuitesHashSigAlgo(sa->hashSigAlgo, SIG_ALL, 1, ssl->buffers.keySz,
|
||||||
&hashSigAlgoSz);
|
&hashSigAlgoSz);
|
||||||
ret = TLSX_Push(&ssl->extensions, TLSX_SIGNATURE_ALGORITHMS, sa, ssl->heap);
|
ret = TLSX_Push(&ssl->extensions, TLSX_SIGNATURE_ALGORITHMS, sa, ssl->heap);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
@ -4039,6 +4039,9 @@ enum KeyExchangeAlgorithm {
|
|||||||
#define SIG_FALCON 0x08
|
#define SIG_FALCON 0x08
|
||||||
#define SIG_DILITHIUM 0x10
|
#define SIG_DILITHIUM 0x10
|
||||||
#define SIG_ANON 0x20
|
#define SIG_ANON 0x20
|
||||||
|
/* SIG_ANON is omitted by default */
|
||||||
|
#define SIG_ALL (SIG_ECDSA | SIG_RSA | SIG_SM2 | SIG_FALCON | \
|
||||||
|
SIG_DILITHIUM)
|
||||||
|
|
||||||
/* Supported Authentication Schemes */
|
/* Supported Authentication Schemes */
|
||||||
enum SignatureAlgorithm {
|
enum SignatureAlgorithm {
|
||||||
|
Reference in New Issue
Block a user