Skip to content

Commit

Permalink
adjust macro guard to avoid leak for build without cert support
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Sep 27, 2024
1 parent df17913 commit f092271
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,7 @@ int wolfSSH_ProcessBuffer(WOLFSSH_CTX* ctx,
int format, int type)
{
void* heap = NULL;
byte* der;
byte* der = NULL;
word32 derSz;
int wcType;
int ret = WS_SUCCESS;
Expand All @@ -2078,18 +2078,20 @@ int wolfSSH_ProcessBuffer(WOLFSSH_CTX* ctx,
return WS_BAD_FILETYPE_E;
}

if (type == BUFTYPE_CA) {
if (type == BUFTYPE_PRIVKEY) {
dynamicType = DYNTYPE_PRIVKEY;
wcType = PRIVATEKEY_TYPE;
}
#ifdef WOLFSSH_CERTS
else if (type == BUFTYPE_CA) {
dynamicType = DYNTYPE_CA;
wcType = CA_TYPE;
}
else if (type == BUFTYPE_CERT) {
dynamicType = DYNTYPE_CERT;
wcType = CERT_TYPE;
}
else if (type == BUFTYPE_PRIVKEY) {
dynamicType = DYNTYPE_PRIVKEY;
wcType = PRIVATEKEY_TYPE;
}
#endif
else {
return WS_BAD_ARGUMENT;
}
Expand Down

0 comments on commit f092271

Please sign in to comment.