1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-20 02:42:09 +03:00

kex: do not ignore failure of libssh2_sha1_init()

Based upon 43b730ce56.
Fixes ticket 290. Thanks for the suggestion, mstrsn.
This commit is contained in:
Marc Hoersken
2015-03-23 22:25:50 +01:00
parent 41b1cb6751
commit 7ca44fbd94
6 changed files with 23 additions and 8 deletions

View File

@@ -107,6 +107,8 @@
#define _libssh2_random(buf, len) RAND_bytes ((buf), (len))
#define libssh2_sha1_ctx EVP_MD_CTX
/* returns 0 in case of failure */
int libssh2_sha1_init(libssh2_sha1_ctx *ctx);
#define libssh2_sha1_update(ctx, data, len) EVP_DigestUpdate(&(ctx), data, len)
#define libssh2_sha1_final(ctx, out) EVP_DigestFinal(&(ctx), out, NULL)