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

openssl: make libssh2_sha1 return error code

- use the internal prefix _libssh2_ for non-exported functions

- removed libssh2_md5() since it wasn't used

Reported-by: Kamil Dudka
This commit is contained in:
Daniel Stenberg
2015-06-12 10:53:18 +02:00
parent d754fee2f2
commit e9536edede
2 changed files with 18 additions and 23 deletions

View File

@@ -109,18 +109,21 @@
#define libssh2_sha1_ctx EVP_MD_CTX
/* returns 0 in case of failure */
int libssh2_sha1_init(libssh2_sha1_ctx *ctx);
int _libssh2_sha1_init(libssh2_sha1_ctx *ctx);
#define libssh2_sha1_init(x) _libssh2_sha1_init(x)
#define libssh2_sha1_update(ctx, data, len) EVP_DigestUpdate(&(ctx), data, len)
#define libssh2_sha1_final(ctx, out) EVP_DigestFinal(&(ctx), out, NULL)
void libssh2_sha1(const unsigned char *message, unsigned long len, unsigned char *out);
int _libssh2_sha1(const unsigned char *message, unsigned long len,
unsigned char *out);
#define libssh2_sha1(x,y,z) _libssh2_sha1(x,y,z)
#define libssh2_md5_ctx EVP_MD_CTX
/* returns 0 in case of failure */
int libssh2_md5_init(libssh2_md5_ctx *);
int _libssh2_md5_init(libssh2_md5_ctx *);
#define libssh2_md5_init(x) _libssh2_md5_init(x)
#define libssh2_md5_update(ctx, data, len) EVP_DigestUpdate(&(ctx), data, len)
#define libssh2_md5_final(ctx, out) EVP_DigestFinal(&(ctx), out, NULL)
void libssh2_md5(const unsigned char *message, unsigned long len, unsigned char *out);
#define libssh2_hmac_ctx HMAC_CTX
#define libssh2_hmac_ctx_init(ctx) \