Skip to content

Commit 35a24e3

Browse files
authored
Merge pull request #808 from gojimmypi/pr-DoAsn1Key-RSA-check
DoAsn1Key now fails when WOLFSSH_NO_RSA is defined
2 parents 7f625da + 429cf16 commit 35a24e3

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
@@ -1737,6 +1737,7 @@ static int DoAsn1Key(const byte* in, word32 inSz, byte** out,
17371737
}
17381738

17391739
if (ret > 0 && !isPrivate) {
1740+
#ifndef WOLFSSH_NO_RSA
17401741
long e;
17411742
byte n[RSA_MAX_SIZE]; /* TODO: Handle small stack */
17421743
word32 nSz = (word32)sizeof(n), eSz = (word32)sizeof(e);
@@ -1785,6 +1786,10 @@ static int DoAsn1Key(const byte* in, word32 inSz, byte** out,
17851786

17861787
*out = newKey;
17871788
}
1789+
#else
1790+
WLOG(WS_LOG_DEBUG, "DoAsn1Key failed; WOLFSSH_NO_RSA disabled RSA");
1791+
ret = WS_UNIMPLEMENTED_E;
1792+
#endif
17881793
}
17891794
else if (ret > 0 && isPrivate) {
17901795
if (*out == NULL) {

0 commit comments

Comments
 (0)