diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2005-05-31 21:01:25 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2005-05-31 21:01:25 +0000 |
commit | 35865d51c9939744569e6df25c64a1d6723e224b (patch) | |
tree | 9e588200bfd9e6f7584549c8f6dd0c518c194e97 | |
parent | 8c3aea6ae9f7533344845098937dd260c1685d86 (diff) | |
download | gnutls-35865d51c9939744569e6df25c64a1d6723e224b.tar.gz |
fixed some type conflicts.
-rw-r--r-- | lib/gnutls_int.h | 2 | ||||
-rw-r--r-- | lib/gnutls_ui.c | 4 | ||||
-rw-r--r-- | lib/x509/crl_write.c | 2 | ||||
-rw-r--r-- | lib/x509/crq.c | 2 | ||||
-rw-r--r-- | lib/x509/mpi.c | 2 | ||||
-rw-r--r-- | lib/x509/sign.c | 4 | ||||
-rw-r--r-- | lib/x509/x509_write.c | 2 |
7 files changed, 10 insertions, 8 deletions
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h index 7bbe00810c..937c642389 100644 --- a/lib/gnutls_int.h +++ b/lib/gnutls_int.h @@ -104,6 +104,8 @@ #define DECR_LENGTH_RET(len, x, RET) do { len-=x; if (len<0) {gnutls_assert(); return RET;} } while (0) #define DECR_LENGTH_COM(len, x, COM) do { len-=x; if (len<0) {gnutls_assert(); COM;} } while (0) +#define HASH2MAC(x) ((gnutls_mac_algorithm_t)x) + typedef unsigned char opaque; typedef struct { opaque pint[3]; diff --git a/lib/gnutls_ui.c b/lib/gnutls_ui.c index e3e029185c..c9d2157f31 100644 --- a/lib/gnutls_ui.c +++ b/lib/gnutls_ui.c @@ -461,7 +461,7 @@ int gnutls_fingerprint(gnutls_digest_algorithm_t algo, size_t * result_size) { GNUTLS_HASH_HANDLE td; - int hash_len = _gnutls_hash_get_algo_len(algo); + int hash_len = _gnutls_hash_get_algo_len(HASH2MAC(algo)); if (hash_len < 0 || (uint) hash_len > *result_size || result == NULL) { *result_size = hash_len; @@ -470,7 +470,7 @@ int gnutls_fingerprint(gnutls_digest_algorithm_t algo, *result_size = hash_len; if (result) { - td = _gnutls_hash_init(algo); + td = _gnutls_hash_init(HASH2MAC(algo)); if (td == NULL) return GNUTLS_E_HASH_FAILED; diff --git a/lib/x509/crl_write.c b/lib/x509/crl_write.c index 62f8fa8400..a92a359f5b 100644 --- a/lib/x509/crl_write.c +++ b/lib/x509/crl_write.c @@ -136,7 +136,7 @@ int gnutls_x509_crl_sign2(gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer, int gnutls_x509_crl_sign(gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer, gnutls_x509_privkey_t issuer_key) { - return gnutls_x509_crl_sign2( crl, issuer, issuer_key, GNUTLS_MAC_SHA1, 0); + return gnutls_x509_crl_sign2( crl, issuer, issuer_key, GNUTLS_DIG_SHA1, 0); } /** diff --git a/lib/x509/crq.c b/lib/x509/crq.c index 8855f3b85b..c911d20af6 100644 --- a/lib/x509/crq.c +++ b/lib/x509/crq.c @@ -753,7 +753,7 @@ int gnutls_x509_crq_sign2(gnutls_x509_crq_t crq, gnutls_x509_privkey_t key, **/ int gnutls_x509_crq_sign(gnutls_x509_crq_t crq, gnutls_x509_privkey_t key) { - return gnutls_x509_crq_sign2(crq, key, GNUTLS_MAC_SHA1, 0); + return gnutls_x509_crq_sign2(crq, key, GNUTLS_DIG_SHA1, 0); } /** diff --git a/lib/x509/mpi.c b/lib/x509/mpi.c index 0ef4b68287..280aa794f5 100644 --- a/lib/x509/mpi.c +++ b/lib/x509/mpi.c @@ -346,7 +346,7 @@ int _gnutls_x509_write_sig_params(ASN1_TYPE dst, const char *dst_name, _gnutls_str_cpy(name, sizeof(name), dst_name); _gnutls_str_cat(name, sizeof(name), ".algorithm"); - pk = _gnutls_x509_sign_to_oid(pk_algorithm, dig); + pk = _gnutls_x509_sign_to_oid(pk_algorithm, HASH2MAC(dig)); if (pk == NULL) { gnutls_assert(); return GNUTLS_E_INVALID_REQUEST; diff --git a/lib/x509/sign.c b/lib/x509/sign.c index 01f4bf5425..e712858a1e 100644 --- a/lib/x509/sign.c +++ b/lib/x509/sign.c @@ -126,7 +126,7 @@ pkcs1_rsa_sign(gnutls_digest_algorithm_t hash, const gnutls_datum_t * text, GNUTLS_HASH_HANDLE hd; gnutls_datum_t digest, info; - hd = _gnutls_hash_init(hash); + hd = _gnutls_hash_init(HASH2MAC(hash)); if (hd == NULL) { gnutls_assert(); return GNUTLS_E_HASH_FAILED; @@ -136,7 +136,7 @@ pkcs1_rsa_sign(gnutls_digest_algorithm_t hash, const gnutls_datum_t * text, _gnutls_hash_deinit(hd, _digest); digest.data = _digest; - digest.size = _gnutls_hash_get_algo_len(hash); + digest.size = _gnutls_hash_get_algo_len(HASH2MAC(hash)); /* Encode the digest as a DigestInfo */ diff --git a/lib/x509/x509_write.c b/lib/x509/x509_write.c index d3b7254767..aa83cd503c 100644 --- a/lib/x509/x509_write.c +++ b/lib/x509/x509_write.c @@ -475,7 +475,7 @@ int gnutls_x509_crt_sign2(gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer, int gnutls_x509_crt_sign(gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer, gnutls_x509_privkey_t issuer_key) { - return gnutls_x509_crt_sign2( crt, issuer, issuer_key, GNUTLS_MAC_SHA1, 0); + return gnutls_x509_crt_sign2( crt, issuer, issuer_key, GNUTLS_DIG_SHA1, 0); } /** |