Skip to content

Commit

Permalink
Gate CalcRsaInverses on WOLFSSH_NO_RSA; Gate GetOpenSshKeyEcc on WOLF…
Browse files Browse the repository at this point in the history
…SSH_NO_ECDSA and WOLFSSH_NO_ECC
  • Loading branch information
gojimmypi committed Jan 11, 2024
1 parent 321023e commit d32051e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,7 @@ static INLINE int GetMpintToMp(mp_int* mp,
}


#ifndef WOLFSSH_NO_RSA
/*
* For the given RSA key, calculate p^-1 and q^-1. wolfCrypt's RSA
* code expects them, but the OpenSSH format key doesn't store them.
Expand All @@ -1073,7 +1074,6 @@ static INLINE int CalcRsaInverses(RsaKey* key)
return ret;
}

#ifndef WOLFSSH_NO_RSA
/*
* Utility for GetOpenSshKey() to read in RSA keys.
*/
Expand Down Expand Up @@ -1107,6 +1107,8 @@ static int GetOpenSshKeyRsa(RsaKey* key,
}
#endif


#if !defined(WOLFSSH_NO_ECDSA) && !defined(WOLFSSH_NO_ECC)
/*
* Utility for GetOpenSshKey() to read in ECDSA keys.
*/
Expand Down Expand Up @@ -1134,7 +1136,7 @@ static int GetOpenSshKeyEcc(ecc_key* key,

return ret;
}

#endif

/*
* Decodes an OpenSSH format key.
Expand Down Expand Up @@ -1218,7 +1220,7 @@ static int GetOpenSshKey(WS_KeySignature *key,
str, strSz, &subIdx);
break;
#endif
#ifndef WOLFSSH_NO_ECDSA
#if !defined(WOLFSSH_NO_ECDSA) && !defined(WOLFSSH_NO_ECC)
case ID_ECDSA_SHA2_NISTP256:
ret = GetOpenSshKeyEcc(&key->ks.ecc.key,
str, strSz, &subIdx);
Expand Down

0 comments on commit d32051e

Please sign in to comment.