Skip to content

Commit

Permalink
fix WOLFSSH_NO_RSA
Browse files Browse the repository at this point in the history
  • Loading branch information
miyazakh committed Jan 27, 2024
1 parent dce3cf0 commit b256522
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/client/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ int ClientUseCert(const char* certName)
* returns 0 on success */
int ClientSetPrivateKey(const char* privKeyName, int userEcc)
{
int ret;
int ret = 0;

if (privKeyName == NULL) {
if (userEcc) {
Expand Down Expand Up @@ -682,7 +682,7 @@ int ClientSetPrivateKey(const char* privKeyName, int userEcc)
* returns 0 on success */
int ClientUsePubKey(const char* pubKeyName, int userEcc)
{
int ret;
int ret = 0;

if (pubKeyName == NULL) {
byte* p = userPublicKey;
Expand Down
3 changes: 2 additions & 1 deletion examples/sftpclient/sftpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
socklen_t clientAddrSz = sizeof(clientAddr);
int ret;
int ch;
int userEcc = 0;
/* int peerEcc = 0; */
word16 port = wolfSshPort;
char* host = (char*)wolfSshIp;
Expand Down Expand Up @@ -1262,7 +1263,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
}
#endif

ret = ClientSetPrivateKey(privKeyName, 0);
ret = ClientSetPrivateKey(privKeyName, userEcc);
if (ret != 0) {
err_sys("Error setting private key");
}
Expand Down
2 changes: 1 addition & 1 deletion src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -6829,7 +6829,7 @@ static int DoChannelOpen(WOLFSSH* ssh,
word32 typeSz;
char type[32];
byte typeId = ID_UNKNOWN;
word32 peerChannelId;
word32 peerChannelId = 0;
word32 peerInitialWindowSz;
word32 peerMaxPacketSz;
#ifdef WOLFSSH_FWD
Expand Down
1 change: 1 addition & 0 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ static void test_wolfSSH_ReadKey(void)
#ifndef WOLFSSH_NO_ECDSA_SHA2_NISTP256

/* OpenSSH Format, ecdsa-sha2-nistp256, private, need alloc */
(void)keyCheck;
key = NULL;
keySz = 0;
keyType = NULL;
Expand Down
2 changes: 2 additions & 0 deletions wolfssh/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1204,9 +1204,11 @@ WOLFSSH_LOCAL int wsScpSendCallback(WOLFSSH*, int, const char*, char*, word32,


WOLFSSH_LOCAL int wolfSSH_CleanPath(WOLFSSH* ssh, char* in);
#ifndef WOLFSSH_NO_RSA
WOLFSSH_LOCAL int wolfSSH_RsaVerify(byte *sig, word32 sigSz,
const byte* digest, word32 digestSz,
RsaKey* key, void* heap, const char* loc);
#endif
WOLFSSH_LOCAL void DumpOctetString(const byte*, word32);
WOLFSSH_LOCAL int wolfSSH_oct2dec(WOLFSSH* ssh, byte* oct, word32 octSz);
WOLFSSH_LOCAL void AddAssign64(word32*, word32);
Expand Down

0 comments on commit b256522

Please sign in to comment.