Skip to content

allow private-key from memory using mbedtls - #311

Closed
doublex wants to merge 2 commits into
libssh2:masterfrom
doublex:master
Closed

doublex wants to merge 2 commits into
libssh2:masterfrom
doublex:master

Conversation

@doublex

@doublex doublex commented Mar 11, 2019

Copy link
Copy Markdown
Contributor

And fix passphrase

Comment thread src/mbedtls.c
Using a private-key from memory will fail if the last byte is not a null terminator
*/
filedata_null = mbedtls_calloc(1, filedata_len + 1);
memcpy(filedata_null, filedata, filedata_len);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no null check here before calling memcpy and mbedtls_free, probably worth adding. Same thing is replicated on line 652.

@doublex

doublex commented Apr 19, 2019

Copy link
Copy Markdown
Contributor Author

See #358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants