summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-06-30 20:35:12 +0300
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-06-30 20:35:12 +0300
commit1c5c67235547d751cb69dbf1f13427dbb9eb3093 (patch)
tree07ff7c87824f80aeb2952885002598133a99136a
parent86359ef973596502b5b0dfa408b55492e829c60c (diff)
downloadgnutls-1c5c67235547d751cb69dbf1f13427dbb9eb3093.tar.gz
corrected openssl.
-rw-r--r--includes/gnutls/openssl.h5
-rw-r--r--libextra/gnutls_openssl.c25
2 files changed, 17 insertions, 13 deletions
diff --git a/includes/gnutls/openssl.h b/includes/gnutls/openssl.h
index 2b49e4b8fa..483668933c 100644
--- a/includes/gnutls/openssl.h
+++ b/includes/gnutls/openssl.h
@@ -168,8 +168,9 @@ extern "C"
#define rbio gnutls_state
- struct MD_CTX_INT;
- typedef struct MD_CTX_INT MD_CTX;
+ typedef struct {
+ void* handle;
+ } MD_CTX;
struct rsa_st;
typedef struct rsa_st RSA;
diff --git a/libextra/gnutls_openssl.c b/libextra/gnutls_openssl.c
index ecc6bdce9c..a0628c9391 100644
--- a/libextra/gnutls_openssl.c
+++ b/libextra/gnutls_openssl.c
@@ -38,11 +38,6 @@
static int last_error = 0;
-struct MD_CTX_INT
-{
- digest_hd_st handle;
-};
-
/* Library initialisation functions */
int
@@ -1008,19 +1003,23 @@ RAND_egd_bytes (const char *path, int bytes)
void
MD5_Init (MD5_CTX * ctx)
{
- _gnutls_hash_init( &ctx->handle, GNUTLS_DIG_MD5);
+ ctx->handle = gnutls_malloc( sizeof(digest_hd_st));
+ if (!ctx->handle)
+ abort();
+ _gnutls_hash_init( ctx->handle, GNUTLS_DIG_MD5);
}
void
MD5_Update (MD5_CTX * ctx, const void *buf, int len)
{
- _gnutls_hash( &ctx->handle, buf, len);
+ _gnutls_hash( ctx->handle, buf, len);
}
void
MD5_Final (unsigned char *md, MD5_CTX * ctx)
{
- _gnutls_hash_deinit( &ctx->handle, md);
+ _gnutls_hash_deinit( ctx->handle, md);
+ gnutls_free(ctx->handle);
}
unsigned char *
@@ -1037,19 +1036,23 @@ MD5 (const unsigned char *buf, unsigned long len, unsigned char *md)
void
RIPEMD160_Init (RIPEMD160_CTX * ctx)
{
- _gnutls_hash_init( &ctx->handle, GNUTLS_DIG_RMD160);
+ ctx->handle = gnutls_malloc( sizeof(digest_hd_st));
+ if (!ctx->handle)
+ abort();
+ _gnutls_hash_init( ctx->handle, GNUTLS_DIG_RMD160);
}
void
RIPEMD160_Update (RIPEMD160_CTX * ctx, const void *buf, int len)
{
- _gnutls_hash( &ctx->handle, buf, len);
+ _gnutls_hash( ctx->handle, buf, len);
}
void
RIPEMD160_Final (unsigned char *md, RIPEMD160_CTX * ctx)
{
- _gnutls_hash_deinit( &ctx->handle, md);
+ _gnutls_hash_deinit( ctx->handle, md);
+ gnutls_free(ctx->handle);
}
unsigned char *