Skip to content

Commit f524634

Browse files
committed
DoAsn1Key now fails when WOLFSSH_NO_RSA is defined
1 parent 5cd826c commit f524634

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ssh.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,7 @@ static int DoAsn1Key(const byte* in, word32 inSz, byte** out,
17471747
*outType = (const byte*)IdToName(ret);
17481748
*outTypeSz = (word32)WSTRLEN((const char*)*outType);
17491749

1750+
#ifndef WOLFSSH_NO_RSA
17501751
ret = wc_RsaFlattenPublicKey(&key->ks.rsa.key, (byte*)&e, &eSz, n, &nSz);
17511752
if (ret == 0) {
17521753
if (n[0] & 0x80) {
@@ -1762,6 +1763,10 @@ static int DoAsn1Key(const byte* in, word32 inSz, byte** out,
17621763
ret = WS_MEMORY_E;
17631764
}
17641765
}
1766+
#else
1767+
WLOG(WS_LOG_DEBUG, "DoAsn1Key failed; WOLFSSH_NO_RSA disabled RSA");
1768+
ret = WS_RSA_E;
1769+
#endif
17651770
if (ret == 0) {
17661771
/* encode the key format string */
17671772
c32toa((word32)WSTRLEN(keyFormat), &newKey[idx]);

0 commit comments

Comments
 (0)