aboutsummaryrefslogtreecommitdiff
path: root/libssh/wrapper.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-17 08:31:59 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-17 08:31:59 +0000
commitb15a04e4636982c63720e2745dc0ac9ccd17df3f (patch)
tree7900dfdac28eeed61d060756a61f7e93bd1c92b7 /libssh/wrapper.c
parent2b12ffc820449e9b830220d914c51dc7605393f2 (diff)
downloadlibssh-b15a04e4636982c63720e2745dc0ac9ccd17df3f.tar.gz
libssh-b15a04e4636982c63720e2745dc0ac9ccd17df3f.tar.xz
libssh-b15a04e4636982c63720e2745dc0ac9ccd17df3f.zip
Improve sha1_init().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@515 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/wrapper.c')
-rw-r--r--libssh/wrapper.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/libssh/wrapper.c b/libssh/wrapper.c
index 46e2b232..82cddb7c 100644
--- a/libssh/wrapper.c
+++ b/libssh/wrapper.c
@@ -52,10 +52,11 @@ static int alloc_key(struct crypto_struct *cipher) {
#ifdef HAVE_LIBGCRYPT
#include <gcrypt.h>
-SHACTX sha1_init(){
- SHACTX ret;
- gcry_md_open(&ret,GCRY_MD_SHA1,0);
- return ret;
+SHACTX sha1_init(void) {
+ SHACTX ctx = NULL;
+ gcry_md_open(&ctx, GCRY_MD_SHA1, 0);
+
+ return ctx;
}
void sha1_update(SHACTX c, const void *data, unsigned long len){
gcry_md_write(c,data,len);
@@ -249,13 +250,14 @@ static struct crypto_struct ssh_ciphertab[]={
#define OLD_CRYPTO
#endif
-SHACTX sha1_init(){
- SHACTX c = malloc(sizeof(*c));
- if (c == NULL) {
- return NULL;
- }
- SHA1_Init(c);
- return c;
+SHACTX sha1_init(void) {
+ SHACTX ctx = malloc(sizeof(*c));
+ if (c == NULL) {
+ return NULL;
+ }
+ SHA1_Init(c);
+
+ return c;
}
void sha1_update(SHACTX c, const void *data, unsigned long len){
SHA1_Update(c,data,len);