Skip to content

Commit 0b0c05a

Browse files
committed
Fix wolfSSH_ProcessBuffer to check type
1 parent e8f54ae commit 0b0c05a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/internal.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2403,7 +2403,10 @@ int wolfSSH_ProcessBuffer(WOLFSSH_CTX* ctx,
24032403
if (der == NULL)
24042404
return WS_MEMORY_E;
24052405

2406-
ret = wc_CertPemToDer(in, inSz, der, inSz, wcType);
2406+
if (type == BUFTYPE_PRIVKEY)
2407+
ret = wc_KeyPemToDer(in, inSz, der, inSz, NULL);
2408+
else
2409+
ret = wc_CertPemToDer(in, inSz, der, inSz, wcType);
24072410
if (ret < 0) {
24082411
WFREE(der, heap, dynamicType);
24092412
return WS_BAD_FILE_E;

0 commit comments

Comments
 (0)