diff --git a/src/internal.c b/src/internal.c index 744536993..075bfe2d6 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1321,6 +1321,14 @@ WOLFSSH* SshInit(WOLFSSH* ssh, WOLFSSH_CTX* ctx) ssh->keyingCompletionCtx = (void*)ssh; + if (wc_AesInit(&ssh->encryptCipher.aes, heap, INVALID_DEVID) != 0 || + wc_AesInit(&ssh->decryptCipher.aes, heap, INVALID_DEVID) != 0) { + + WLOG(WS_LOG_DEBUG, "SshInit: Cannot initialize ciphers.\n"); + wolfSSH_free(ssh); + return NULL; + } + if (BufferInit(&ssh->inputBuffer, 0, ctx->heap) != WS_SUCCESS || BufferInit(&ssh->outputBuffer, 0, ctx->heap) != WS_SUCCESS || BufferInit(&ssh->extDataBuffer, 0, ctx->heap) != WS_SUCCESS) {