diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2009-12-01 23:32:44 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2009-12-01 23:32:44 +0200 |
commit | f8ba2b625f822e5b545a25e11fbbc5a081248318 (patch) | |
tree | 8a41117a2551fade76b5bd849dfe3c0d0e637491 | |
parent | b405914df9cb2a0831db9baaa5d8ed502e33af4f (diff) | |
download | gnutls-f8ba2b625f822e5b545a25e11fbbc5a081248318.tar.gz |
Corrected compilation issues.
-rw-r--r-- | lib/cryptodev.c | 8 | ||||
-rw-r--r-- | lib/gnutls_cryptodev.h | 4 | ||||
-rw-r--r-- | lib/gnutls_hash_int.c | 5 | ||||
-rw-r--r-- | lib/gnutls_hash_int.h | 5 | ||||
-rw-r--r-- | lib/mac-libgcrypt.c | 44 | ||||
-rw-r--r-- | lib/x509/mpi.c | 1 |
6 files changed, 10 insertions, 57 deletions
diff --git a/lib/cryptodev.c b/lib/cryptodev.c index ebe1dfc367..e72a2accfc 100644 --- a/lib/cryptodev.c +++ b/lib/cryptodev.c @@ -27,6 +27,7 @@ #include <sys/ioctl.h> #include <fcntl.h> #include <gnutls/crypto.h> +#include <gnutls_cryptodev.h> #ifdef ENABLE_CRYPTODEV @@ -47,7 +48,7 @@ struct cryptodev_ctx { int cfd; }; -const static int gnutls_cipher_map[] = { +static const int gnutls_cipher_map[] = { [GNUTLS_CIPHER_AES_128_CBC] = CRYPTO_AES_CBC, [GNUTLS_CIPHER_AES_192_CBC] = CRYPTO_AES_CBC, [GNUTLS_CIPHER_AES_256_CBC] = CRYPTO_AES_CBC, @@ -153,7 +154,7 @@ struct cryptodev_ctx* ctx = _ctx; gnutls_free(ctx); } -const static gnutls_crypto_cipher_st cipher_struct = { +static const gnutls_crypto_cipher_st cipher_struct = { .init = cryptodev_cipher_init, .setkey = cryptodev_setkey, .setiv = cryptodev_setiv, @@ -182,7 +183,6 @@ static const struct cipher_map cipher_map[] = { static int register_crypto(int cfd) { struct session_op sess; - struct crypt_op cryp; char fake_key[CRYPTO_CIPHER_MAX_KEY_LEN]; int i=0, ret; @@ -208,7 +208,7 @@ static int register_crypto(int cfd) return 0; } -int _gnutls_cryptodev_init() +int _gnutls_cryptodev_init(void) { int cfd = -1, ret; diff --git a/lib/gnutls_cryptodev.h b/lib/gnutls_cryptodev.h index 645cce0062..c655479ee4 100644 --- a/lib/gnutls_cryptodev.h +++ b/lib/gnutls_cryptodev.h @@ -1,2 +1,2 @@ -void _gnutls_cryptodev_deinit(); -int _gnutls_cryptodev_init(); +void _gnutls_cryptodev_deinit(void); +int _gnutls_cryptodev_init(void); diff --git a/lib/gnutls_hash_int.c b/lib/gnutls_hash_int.c index 1c79e3aaaf..c70fa8f81b 100644 --- a/lib/gnutls_hash_int.c +++ b/lib/gnutls_hash_int.c @@ -149,7 +149,7 @@ _gnutls_hash_init (hash_hd_st * dig, gnutls_digest_algorithm_t algorithm, } int -_gnutls_hash (const hash_hd_st * handle, const void *text, size_t textlen) +_gnutls_hash (hash_hd_st * handle, const void *text, size_t textlen) { if (textlen > 0) { @@ -208,8 +208,7 @@ _gnutls_hash_copy (hash_hd_st * dst, hash_hd_st * src) return 0; } -void -_gnutls_hash_reset (hash_hd_st * handle) +void _gnutls_hash_reset (hash_hd_st * handle) { if (handle->registered && handle->hd.rh.ctx != NULL) { diff --git a/lib/gnutls_hash_int.h b/lib/gnutls_hash_int.h index 841ff10255..bc39a1a769 100644 --- a/lib/gnutls_hash_int.h +++ b/lib/gnutls_hash_int.h @@ -56,14 +56,13 @@ typedef struct int _gnutls_hash_init (hash_hd_st*, gnutls_digest_algorithm_t algorithm, const void *key, int keylen); int _gnutls_hash_get_algo_len (gnutls_digest_algorithm_t algorithm); -int _gnutls_hmac (hash_hd_st* handle, const void *text, - size_t textlen); - +int _gnutls_hash (hash_hd_st * handle, const void *text, size_t textlen); int _gnutls_hash_fast( gnutls_digest_algorithm_t algorithm, const void* key, int keylen, const void* text, size_t textlen, void* digest); void _gnutls_hash_deinit (hash_hd_st* handle, void *digest); void _gnutls_hash_output (hash_hd_st* handle, void *digest); +void _gnutls_hash_reset (hash_hd_st * handle); /* help functions */ int _gnutls_mac_init_ssl3 (hash_hd_st*, gnutls_digest_algorithm_t algorithm, void *key, diff --git a/lib/mac-libgcrypt.c b/lib/mac-libgcrypt.c index 28184ef9e2..acb9deba1d 100644 --- a/lib/mac-libgcrypt.c +++ b/lib/mac-libgcrypt.c @@ -97,50 +97,6 @@ wrap_gcry_md_close (void *hd) } static int -wrap_gcry_hash_init (gnutls_digest_algorithm_t algo, void **ctx) -{ - int err; - unsigned int flags = 0; - - switch (algo) - { - case GNUTLS_DIG_MD5: - err = gcry_md_open ((gcry_md_hd_t *) ctx, GCRY_MD_MD5, flags); - break; - case GNUTLS_DIG_SHA1: - err = gcry_md_open ((gcry_md_hd_t *) ctx, GCRY_MD_SHA1, flags); - break; - case GNUTLS_DIG_RMD160: - err = gcry_md_open ((gcry_md_hd_t *) ctx, GCRY_MD_RMD160, flags); - break; - case GNUTLS_DIG_MD2: - err = gcry_md_open ((gcry_md_hd_t *) ctx, GCRY_MD_MD2, flags); - break; - case GNUTLS_DIG_SHA256: - err = gcry_md_open ((gcry_md_hd_t *) ctx, GCRY_MD_SHA256, flags); - break; - case GNUTLS_DIG_SHA224: - err = gcry_md_open ((gcry_md_hd_t *) ctx, GCRY_MD_SHA224, flags); - break; - case GNUTLS_DIG_SHA384: - err = gcry_md_open ((gcry_md_hd_t *) ctx, GCRY_MD_SHA384, flags); - break; - case GNUTLS_DIG_SHA512: - err = gcry_md_open ((gcry_md_hd_t *) ctx, GCRY_MD_SHA512, flags); - break; - default: - gnutls_assert (); - return GNUTLS_E_INVALID_REQUEST; - } - - if (err == 0) - return 0; - - gnutls_assert (); - return GNUTLS_E_ENCRYPTION_FAILED; -} - -static int wrap_gcry_mac_output (void *src_ctx, void *digest, size_t digestsize) { opaque *_digest = gcry_md_read (src_ctx, 0); diff --git a/lib/x509/mpi.c b/lib/x509/mpi.c index aad73123b4..6e567f65a5 100644 --- a/lib/x509/mpi.c +++ b/lib/x509/mpi.c @@ -420,7 +420,6 @@ _gnutls_x509_write_sig_params (ASN1_TYPE dst, const char *dst_name, gnutls_digest_algorithm_t dig, bigint_t * params, int params_size) { - gnutls_datum_t der; int result; char name[128]; const char *pk; |