forked from wolfSSL/wolfssl
asn.c/asn.h: fix --disable-ecc --enable-dsa.
This commit is contained in:
@ -2919,6 +2919,7 @@ int wc_CheckPrivateKey(const byte* privKey, word32 privKeySz,
|
|||||||
int ret;
|
int ret;
|
||||||
(void)privKeySz;
|
(void)privKeySz;
|
||||||
(void)pubKeySz;
|
(void)pubKeySz;
|
||||||
|
(void)ks;
|
||||||
|
|
||||||
if (privKey == NULL || pubKey == NULL) {
|
if (privKey == NULL || pubKey == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
@ -7293,7 +7294,6 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
|
|||||||
case DSAk:
|
case DSAk:
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
mp_int r, s;
|
|
||||||
|
|
||||||
if (sigSz < DSA_SIG_SIZE) {
|
if (sigSz < DSA_SIG_SIZE) {
|
||||||
WOLFSSL_MSG("Verify Signature is too small");
|
WOLFSSL_MSG("Verify Signature is too small");
|
||||||
@ -7316,7 +7316,9 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
|
|||||||
goto exit_cs;
|
goto exit_cs;
|
||||||
}
|
}
|
||||||
if (sigSz != DSA_SIG_SIZE) {
|
if (sigSz != DSA_SIG_SIZE) {
|
||||||
|
#ifdef HAVE_ECC
|
||||||
/* Try to parse it as the contents of a bitstring */
|
/* Try to parse it as the contents of a bitstring */
|
||||||
|
mp_int r, s;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
if (DecodeECC_DSA_Sig(sig + idx, sigSz - idx,
|
if (DecodeECC_DSA_Sig(sig + idx, sigSz - idx,
|
||||||
&r, &s) != 0) {
|
&r, &s) != 0) {
|
||||||
@ -7335,6 +7337,11 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
|
|||||||
}
|
}
|
||||||
mp_free(&r);
|
mp_free(&r);
|
||||||
mp_free(&s);
|
mp_free(&s);
|
||||||
|
#else
|
||||||
|
WOLFSSL_MSG("DSA Sig is in unrecognized or "
|
||||||
|
"incorrect format");
|
||||||
|
ERROR_OUT(ASN_SIG_CONFIRM_E, exit_cs);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
XMEMCPY(sigCtx->sigCpy, sig, DSA_SIG_SIZE);
|
XMEMCPY(sigCtx->sigCpy, sig, DSA_SIG_SIZE);
|
||||||
|
@ -682,7 +682,7 @@ struct SignatureCtx {
|
|||||||
#if !(defined(NO_RSA) && defined(NO_DSA))
|
#if !(defined(NO_RSA) && defined(NO_DSA))
|
||||||
byte* sigCpy;
|
byte* sigCpy;
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
|
#if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448) || !defined(NO_DSA)
|
||||||
int verify;
|
int verify;
|
||||||
#endif
|
#endif
|
||||||
union {
|
union {
|
||||||
|
Reference in New Issue
Block a user