summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/algorithms/ciphers.c6
-rw-r--r--lib/crypto-api.c4
-rw-r--r--lib/includes/gnutls/crypto.h10
-rw-r--r--lib/includes/gnutls/pkcs12.h12
-rw-r--r--lib/includes/gnutls/pkcs7.h8
-rw-r--r--lib/includes/gnutls/x509.h78
-rw-r--r--lib/x509/crl.c12
-rw-r--r--lib/x509/crq.c24
-rw-r--r--lib/x509/dn.c4
-rw-r--r--lib/x509/pkcs12.c5
-rw-r--r--lib/x509/pkcs12_bag.c14
-rw-r--r--lib/x509/pkcs7.c8
-rw-r--r--lib/x509/verify-high.c12
-rw-r--r--lib/x509/verify.c17
-rw-r--r--lib/x509/x509.c24
-rw-r--r--lib/x509/x509_int.h2
16 files changed, 121 insertions, 119 deletions
diff --git a/lib/algorithms/ciphers.c b/lib/algorithms/ciphers.c
index e5be151ea8..7b358bbc8a 100644
--- a/lib/algorithms/ciphers.c
+++ b/lib/algorithms/ciphers.c
@@ -249,7 +249,7 @@ const cipher_entry_st *cipher_name_to_entry(const char *name)
*
* Since: 2.10.0
**/
-int gnutls_cipher_get_block_size(gnutls_cipher_algorithm_t algorithm)
+unsigned gnutls_cipher_get_block_size(gnutls_cipher_algorithm_t algorithm)
{
size_t ret = 0;
GNUTLS_ALG_LOOP(ret = p->blocksize);
@@ -265,7 +265,7 @@ int gnutls_cipher_get_block_size(gnutls_cipher_algorithm_t algorithm)
*
* Since: 3.2.2
**/
-int gnutls_cipher_get_tag_size(gnutls_cipher_algorithm_t algorithm)
+unsigned gnutls_cipher_get_tag_size(gnutls_cipher_algorithm_t algorithm)
{
return _gnutls_cipher_get_tag_size(cipher_to_entry(algorithm));
}
@@ -280,7 +280,7 @@ int gnutls_cipher_get_tag_size(gnutls_cipher_algorithm_t algorithm)
*
* Since: 3.2.0
**/
-int gnutls_cipher_get_iv_size(gnutls_cipher_algorithm_t algorithm)
+unsigned gnutls_cipher_get_iv_size(gnutls_cipher_algorithm_t algorithm)
{
size_t ret = 0;
GNUTLS_ALG_LOOP(ret = p->cipher_iv);
diff --git a/lib/crypto-api.c b/lib/crypto-api.c
index e0d8089770..982148ab4a 100644
--- a/lib/crypto-api.c
+++ b/lib/crypto-api.c
@@ -419,7 +419,7 @@ void gnutls_hmac_deinit(gnutls_hmac_hd_t handle, void *digest)
*
* Since: 2.10.0
**/
-int gnutls_hmac_get_len(gnutls_mac_algorithm_t algorithm)
+unsigned gnutls_hmac_get_len(gnutls_mac_algorithm_t algorithm)
{
return _gnutls_mac_get_algo_len(mac_to_entry(algorithm));
}
@@ -549,7 +549,7 @@ void gnutls_hash_deinit(gnutls_hash_hd_t handle, void *digest)
*
* Since: 2.10.0
**/
-int gnutls_hash_get_len(gnutls_digest_algorithm_t algorithm)
+unsigned gnutls_hash_get_len(gnutls_digest_algorithm_t algorithm)
{
return _gnutls_hash_get_algo_len(hash_to_entry(algorithm));
}
diff --git a/lib/includes/gnutls/crypto.h b/lib/includes/gnutls/crypto.h
index af0cc32913..3abc77e658 100644
--- a/lib/includes/gnutls/crypto.h
+++ b/lib/includes/gnutls/crypto.h
@@ -56,9 +56,9 @@ int gnutls_cipher_add_auth(gnutls_cipher_hd_t handle,
const void *text, size_t text_size);
void gnutls_cipher_deinit(gnutls_cipher_hd_t handle);
-int gnutls_cipher_get_block_size(gnutls_cipher_algorithm_t algorithm) __GNUTLS_CONST__;
-int gnutls_cipher_get_iv_size(gnutls_cipher_algorithm_t algorithm) __GNUTLS_CONST__;
-int gnutls_cipher_get_tag_size(gnutls_cipher_algorithm_t algorithm) __GNUTLS_CONST__;
+unsigned gnutls_cipher_get_block_size(gnutls_cipher_algorithm_t algorithm) __GNUTLS_CONST__;
+unsigned gnutls_cipher_get_iv_size(gnutls_cipher_algorithm_t algorithm) __GNUTLS_CONST__;
+unsigned gnutls_cipher_get_tag_size(gnutls_cipher_algorithm_t algorithm) __GNUTLS_CONST__;
/* AEAD API
*/
@@ -98,7 +98,7 @@ void gnutls_hmac_set_nonce(gnutls_hmac_hd_t handle,
int gnutls_hmac(gnutls_hmac_hd_t handle, const void *text, size_t textlen);
void gnutls_hmac_output(gnutls_hmac_hd_t handle, void *digest);
void gnutls_hmac_deinit(gnutls_hmac_hd_t handle, void *digest);
-int gnutls_hmac_get_len(gnutls_mac_algorithm_t algorithm) __GNUTLS_CONST__;
+unsigned gnutls_hmac_get_len(gnutls_mac_algorithm_t algorithm) __GNUTLS_CONST__;
int gnutls_hmac_fast(gnutls_mac_algorithm_t algorithm,
const void *key, size_t keylen,
const void *text, size_t textlen, void *digest);
@@ -108,7 +108,7 @@ int gnutls_hash_init(gnutls_hash_hd_t * dig,
int gnutls_hash(gnutls_hash_hd_t handle, const void *text, size_t textlen);
void gnutls_hash_output(gnutls_hash_hd_t handle, void *digest);
void gnutls_hash_deinit(gnutls_hash_hd_t handle, void *digest);
-int gnutls_hash_get_len(gnutls_digest_algorithm_t algorithm) __GNUTLS_CONST__;
+unsigned gnutls_hash_get_len(gnutls_digest_algorithm_t algorithm) __GNUTLS_CONST__;
int gnutls_hash_fast(gnutls_digest_algorithm_t algorithm,
const void *text, size_t textlen, void *digest);
diff --git a/lib/includes/gnutls/pkcs12.h b/lib/includes/gnutls/pkcs12.h
index 1442b33bd9..b75efa61c1 100644
--- a/lib/includes/gnutls/pkcs12.h
+++ b/lib/includes/gnutls/pkcs12.h
@@ -110,8 +110,8 @@ typedef enum gnutls_pkcs12_bag_type_t {
} gnutls_pkcs12_bag_type_t;
gnutls_pkcs12_bag_type_t
-gnutls_pkcs12_bag_get_type(gnutls_pkcs12_bag_t bag, int indx);
-int gnutls_pkcs12_bag_get_data(gnutls_pkcs12_bag_t bag, int indx,
+gnutls_pkcs12_bag_get_type(gnutls_pkcs12_bag_t bag, unsigned indx);
+int gnutls_pkcs12_bag_get_data(gnutls_pkcs12_bag_t bag, unsigned indx,
gnutls_datum_t * data);
int gnutls_pkcs12_bag_set_data(gnutls_pkcs12_bag_t bag,
gnutls_pkcs12_bag_type_t type,
@@ -130,15 +130,15 @@ int gnutls_pkcs12_bag_init(gnutls_pkcs12_bag_t * bag);
void gnutls_pkcs12_bag_deinit(gnutls_pkcs12_bag_t bag);
int gnutls_pkcs12_bag_get_count(gnutls_pkcs12_bag_t bag);
-int gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag_t bag, int indx,
+int gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag_t bag, unsigned indx,
gnutls_datum_t * id);
-int gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag_t bag, int indx,
+int gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag_t bag, unsigned indx,
const gnutls_datum_t * id);
int gnutls_pkcs12_bag_get_friendly_name(gnutls_pkcs12_bag_t bag,
- int indx, char **name);
+ unsigned indx, char **name);
int gnutls_pkcs12_bag_set_friendly_name(gnutls_pkcs12_bag_t bag,
- int indx, const char *name);
+ unsigned indx, const char *name);
/* *INDENT-OFF* */
#ifdef __cplusplus
diff --git a/lib/includes/gnutls/pkcs7.h b/lib/includes/gnutls/pkcs7.h
index e640a50da5..6d998bc458 100644
--- a/lib/includes/gnutls/pkcs7.h
+++ b/lib/includes/gnutls/pkcs7.h
@@ -58,7 +58,7 @@ int gnutls_pkcs7_get_signature_count(gnutls_pkcs7_t pkcs7);
int gnutls_pkcs7_get_embedded_data(gnutls_pkcs7_t pkcs7, unsigned idx, gnutls_datum_t *data);
int gnutls_pkcs7_get_crt_count(gnutls_pkcs7_t pkcs7);
-int gnutls_pkcs7_get_crt_raw(gnutls_pkcs7_t pkcs7, int indx,
+int gnutls_pkcs7_get_crt_raw(gnutls_pkcs7_t pkcs7, unsigned indx,
void *certificate, size_t * certificate_size);
int gnutls_pkcs7_set_crt_raw(gnutls_pkcs7_t pkcs7,
@@ -67,7 +67,7 @@ int gnutls_pkcs7_set_crt(gnutls_pkcs7_t pkcs7, gnutls_x509_crt_t crt);
int gnutls_pkcs7_delete_crt(gnutls_pkcs7_t pkcs7, int indx);
int gnutls_pkcs7_get_crl_raw(gnutls_pkcs7_t pkcs7,
- int indx, void *crl, size_t * crl_size);
+ unsigned indx, void *crl, size_t * crl_size);
int gnutls_pkcs7_get_crl_count(gnutls_pkcs7_t pkcs7);
int gnutls_pkcs7_set_crl_raw(gnutls_pkcs7_t pkcs7,
@@ -130,10 +130,10 @@ int gnutls_pkcs7_sign(gnutls_pkcs7_t pkcs7,
int
gnutls_pkcs7_get_crt_raw2(gnutls_pkcs7_t pkcs7,
- int indx, gnutls_datum_t *cert);
+ unsigned indx, gnutls_datum_t *cert);
int
gnutls_pkcs7_get_crl_raw2(gnutls_pkcs7_t pkcs7,
- int indx, gnutls_datum_t *crl);
+ unsigned indx, gnutls_datum_t *crl);
int gnutls_pkcs7_print(gnutls_pkcs7_t pkcs7,
gnutls_certificate_print_formats_t format,
diff --git a/lib/includes/gnutls/x509.h b/lib/includes/gnutls/x509.h
index 045645e4b3..5217942abd 100644
--- a/lib/includes/gnutls/x509.h
+++ b/lib/includes/gnutls/x509.h
@@ -170,19 +170,19 @@ int gnutls_x509_crt_get_issuer_dn(gnutls_x509_crt_t cert,
int gnutls_x509_crt_get_issuer_dn2(gnutls_x509_crt_t cert,
gnutls_datum_t * dn);
int gnutls_x509_crt_get_issuer_dn_oid(gnutls_x509_crt_t cert,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * oid_size);
int gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt_t cert,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
unsigned int raw_flag,
void *buf, size_t * buf_size);
int gnutls_x509_crt_get_dn(gnutls_x509_crt_t cert, char *buf,
size_t * buf_size);
int gnutls_x509_crt_get_dn2(gnutls_x509_crt_t cert, gnutls_datum_t * dn);
-int gnutls_x509_crt_get_dn_oid(gnutls_x509_crt_t cert, int indx,
+int gnutls_x509_crt_get_dn_oid(gnutls_x509_crt_t cert, unsigned indx,
void *oid, size_t * oid_size);
int gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
unsigned int raw_flag, void *buf,
size_t * buf_size);
int gnutls_x509_crt_check_hostname(gnutls_x509_crt_t cert,
@@ -495,7 +495,7 @@ typedef struct gnutls_x509_policy_st {
void gnutls_x509_policy_release(struct gnutls_x509_policy_st
*policy);
-int gnutls_x509_crt_get_policy(gnutls_x509_crt_t crt, int indx, struct gnutls_x509_policy_st
+int gnutls_x509_crt_get_policy(gnutls_x509_crt_t crt, unsigned indx, struct gnutls_x509_policy_st
*policy, unsigned int *critical);
int gnutls_x509_crt_set_policy(gnutls_x509_crt_t crt, const struct gnutls_x509_policy_st
*policy, unsigned int critical);
@@ -507,10 +507,10 @@ const char *gnutls_x509_dn_oid_name(const char *oid, unsigned int flags);
/* Read extensions by OID. */
int gnutls_x509_crt_get_extension_oid(gnutls_x509_crt_t cert,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * oid_size);
int gnutls_x509_crt_get_extension_by_oid(gnutls_x509_crt_t cert,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
void *buf,
size_t * buf_size,
unsigned int *critical);
@@ -518,17 +518,17 @@ int gnutls_x509_crt_get_extension_by_oid(gnutls_x509_crt_t cert,
int gnutls_x509_crq_get_signature_algorithm(gnutls_x509_crq_t crq);
int
gnutls_x509_crq_get_extension_by_oid2(gnutls_x509_crq_t crq,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
gnutls_datum_t *output,
unsigned int *critical);
/* Read extensions by sequence number. */
int gnutls_x509_crt_get_extension_info(gnutls_x509_crt_t cert,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * oid_size,
unsigned int *critical);
int gnutls_x509_crt_get_extension_data(gnutls_x509_crt_t cert,
- int indx, void *data,
+ unsigned indx, void *data,
size_t * sizeof_data);
int
gnutls_x509_crt_get_extension_data2(gnutls_x509_crt_t cert,
@@ -653,10 +653,10 @@ int gnutls_x509_crt_get_raw_dn(gnutls_x509_crt_t cert,
int gnutls_x509_rdn_get(const gnutls_datum_t * idn,
char *buf, size_t * sizeof_buf);
int gnutls_x509_rdn_get_oid(const gnutls_datum_t * idn,
- int indx, void *buf, size_t * sizeof_buf);
+ unsigned indx, void *buf, size_t * sizeof_buf);
int gnutls_x509_rdn_get_by_oid(const gnutls_datum_t * idn,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
unsigned int raw_flag, void *buf,
size_t * sizeof_buf);
@@ -716,10 +716,10 @@ int gnutls_x509_crl_get_issuer_dn(gnutls_x509_crl_t crl,
int gnutls_x509_crl_get_issuer_dn2(gnutls_x509_crl_t crl,
gnutls_datum_t * dn);
int gnutls_x509_crl_get_issuer_dn_by_oid(gnutls_x509_crl_t crl,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
unsigned int raw_flag,
void *buf, size_t * sizeof_buf);
-int gnutls_x509_crl_get_dn_oid(gnutls_x509_crl_t crl, int indx,
+int gnutls_x509_crl_get_dn_oid(gnutls_x509_crl_t crl, unsigned indx,
void *oid, size_t * sizeof_oid);
int gnutls_x509_crl_get_signature_algorithm(gnutls_x509_crl_t crl);
@@ -733,7 +733,7 @@ time_t gnutls_x509_crl_get_this_update(gnutls_x509_crl_t crl);
time_t gnutls_x509_crl_get_next_update(gnutls_x509_crl_t crl);
int gnutls_x509_crl_get_crt_count(gnutls_x509_crl_t crl);
-int gnutls_x509_crl_get_crt_serial(gnutls_x509_crl_t crl, int indx,
+int gnutls_x509_crl_get_crt_serial(gnutls_x509_crl_t crl, unsigned indx,
unsigned char *serial,
size_t * serial_size, time_t * t);
@@ -749,7 +749,7 @@ void gnutls_x509_crl_iter_deinit(gnutls_x509_crl_iter_t);
#define gnutls_x509_crl_get_certificate_count gnutls_x509_crl_get_crt_count
#define gnutls_x509_crl_get_certificate gnutls_x509_crl_get_crt_serial
-int gnutls_x509_crl_check_issuer(gnutls_x509_crl_t crl,
+unsigned gnutls_x509_crl_check_issuer(gnutls_x509_crl_t crl,
gnutls_x509_crt_t issuer);
int gnutls_x509_crl_list_import2(gnutls_x509_crl_t ** crls,
@@ -798,16 +798,16 @@ int gnutls_x509_crl_get_number(gnutls_x509_crl_t crl, void *ret,
size_t * ret_size, unsigned int *critical);
int gnutls_x509_crl_get_extension_oid(gnutls_x509_crl_t crl,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * sizeof_oid);
int gnutls_x509_crl_get_extension_info(gnutls_x509_crl_t crl,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * sizeof_oid,
unsigned int *critical);
int gnutls_x509_crl_get_extension_data(gnutls_x509_crl_t crl,
- int indx, void *data,
+ unsigned indx, void *data,
size_t * sizeof_data);
int
gnutls_x509_crl_get_extension_data2(gnutls_x509_crl_t crl,
@@ -927,24 +927,24 @@ typedef enum gnutls_certificate_verification_profiles_t {
((((unsigned)x)>>24)&0xff)
-int gnutls_x509_crt_check_issuer(gnutls_x509_crt_t cert,
+unsigned gnutls_x509_crt_check_issuer(gnutls_x509_crt_t cert,
gnutls_x509_crt_t issuer);
int gnutls_x509_crt_list_verify(const gnutls_x509_crt_t *
- cert_list, int cert_list_length,
+ cert_list, unsigned cert_list_length,
const gnutls_x509_crt_t * CA_list,
- int CA_list_length,
+ unsigned CA_list_length,
const gnutls_x509_crl_t * CRL_list,
- int CRL_list_length,
+ unsigned CRL_list_length,
unsigned int flags, unsigned int *verify);
int gnutls_x509_crt_verify(gnutls_x509_crt_t cert,
const gnutls_x509_crt_t * CA_list,
- int CA_list_length, unsigned int flags,
+ unsigned CA_list_length, unsigned int flags,
unsigned int *verify);
int gnutls_x509_crl_verify(gnutls_x509_crl_t crl,
const gnutls_x509_crt_t * CA_list,
- int CA_list_length, unsigned int flags,
+ unsigned CA_list_length, unsigned int flags,
unsigned int *verify);
int
@@ -956,14 +956,14 @@ gnutls_x509_crt_verify_data2(gnutls_x509_crt_t crt,
int gnutls_x509_crt_check_revocation(gnutls_x509_crt_t cert,
const gnutls_x509_crl_t *
- crl_list, int crl_list_length);
+ crl_list, unsigned crl_list_length);
int gnutls_x509_crt_get_fingerprint(gnutls_x509_crt_t cert,
gnutls_digest_algorithm_t algo,
void *buf, size_t * buf_size);
int gnutls_x509_crt_get_key_purpose_oid(gnutls_x509_crt_t cert,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * oid_size,
unsigned int *critical);
int gnutls_x509_crt_set_key_purpose_oid(gnutls_x509_crt_t cert,
@@ -1211,10 +1211,10 @@ int gnutls_x509_crq_get_private_key_usage_period(gnutls_x509_crq_t
int gnutls_x509_crq_get_dn(gnutls_x509_crq_t crq, char *buf,
size_t * sizeof_buf);
int gnutls_x509_crq_get_dn2(gnutls_x509_crq_t crq, gnutls_datum_t * dn);
-int gnutls_x509_crq_get_dn_oid(gnutls_x509_crq_t crq, int indx,
+int gnutls_x509_crq_get_dn_oid(gnutls_x509_crq_t crq, unsigned indx,
void *oid, size_t * sizeof_oid);
int gnutls_x509_crq_get_dn_by_oid(gnutls_x509_crq_t crq,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
unsigned int raw_flag, void *buf,
size_t * sizeof_buf);
int gnutls_x509_crq_set_dn(gnutls_x509_crq_t crq, const char *dn,
@@ -1240,7 +1240,7 @@ int gnutls_x509_crq_set_attribute_by_oid(gnutls_x509_crq_t crq,
const char *oid,
void *buf, size_t sizeof_buf);
int gnutls_x509_crq_get_attribute_by_oid(gnutls_x509_crq_t crq,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
void *buf, size_t * sizeof_buf);
int gnutls_x509_crq_export(gnutls_x509_crq_t crq,
@@ -1283,26 +1283,26 @@ int gnutls_x509_crq_set_key_purpose_oid(gnutls_x509_crq_t crq,
const void *oid,
unsigned int critical);
int gnutls_x509_crq_get_key_purpose_oid(gnutls_x509_crq_t crq,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * sizeof_oid,
unsigned int *critical);
int gnutls_x509_crq_get_extension_data(gnutls_x509_crq_t crq,
- int indx, void *data,
+ unsigned indx, void *data,
size_t * sizeof_data);
int
gnutls_x509_crq_get_extension_data2(gnutls_x509_crq_t crq,
unsigned indx,
gnutls_datum_t * data);
int gnutls_x509_crq_get_extension_info(gnutls_x509_crq_t crq,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * sizeof_oid,
unsigned int *critical);
int gnutls_x509_crq_get_attribute_data(gnutls_x509_crq_t crq,
- int indx, void *data,
+ unsigned indx, void *data,
size_t * sizeof_data);
int gnutls_x509_crq_get_attribute_info(gnutls_x509_crq_t crq,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * sizeof_oid);
int gnutls_x509_crq_get_pk_algorithm(gnutls_x509_crq_t crq,
unsigned int *bits);
@@ -1337,7 +1337,7 @@ int gnutls_x509_crq_get_subject_alt_othername_oid(gnutls_x509_crq_t
size_t * ret_size);
int gnutls_x509_crq_get_extension_by_oid(gnutls_x509_crq_t crq,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
void *buf,
size_t * sizeof_buf,
unsigned int *critical);
@@ -1349,7 +1349,7 @@ int gnutls_x509_crq_set_tlsfeatures(gnutls_x509_crq_t crq,
int
gnutls_x509_crt_get_extension_by_oid2(gnutls_x509_crt_t cert,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
gnutls_datum_t *output,
unsigned int *critical);
@@ -1392,7 +1392,7 @@ gnutls_x509_trust_list_add_cas(gnutls_x509_trust_list_t list,
int gnutls_x509_trust_list_remove_cas(gnutls_x509_trust_list_t
list,
const gnutls_x509_crt_t *
- clist, int clist_size);
+ clist, unsigned clist_size);
int gnutls_x509_trust_list_add_named_crt(gnutls_x509_trust_list_t
list,
@@ -1404,7 +1404,7 @@ int gnutls_x509_trust_list_add_named_crt(gnutls_x509_trust_list_t
int
gnutls_x509_trust_list_add_crls(gnutls_x509_trust_list_t list,
const gnutls_x509_crl_t *
- crl_list, int crl_size,
+ crl_list, unsigned crl_size,
unsigned int flags,
unsigned int verification_flags);
diff --git a/lib/x509/crl.c b/lib/x509/crl.c
index 5f20a75051..f42271bd84 100644
--- a/lib/x509/crl.c
+++ b/lib/x509/crl.c
@@ -241,7 +241,7 @@ gnutls_x509_crl_get_issuer_dn(const gnutls_x509_crl_t crl, char *buf,
**/
int
gnutls_x509_crl_get_issuer_dn_by_oid(gnutls_x509_crl_t crl,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
unsigned int raw_flag, void *buf,
size_t * sizeof_buf)
{
@@ -281,7 +281,7 @@ gnutls_x509_crl_get_issuer_dn_by_oid(gnutls_x509_crl_t crl,
**/
int
gnutls_x509_crl_get_dn_oid(gnutls_x509_crl_t crl,
- int indx, void *oid, size_t * sizeof_oid)
+ unsigned indx, void *oid, size_t * sizeof_oid)
{
if (crl == NULL) {
gnutls_assert();
@@ -573,7 +573,7 @@ int gnutls_x509_crl_get_crt_count(gnutls_x509_crl_t crl)
* negative error value.
**/
int
-gnutls_x509_crl_get_crt_serial(gnutls_x509_crl_t crl, int indx,
+gnutls_x509_crl_get_crt_serial(gnutls_x509_crl_t crl, unsigned indx,
unsigned char *serial,
size_t * serial_size, time_t * t)
{
@@ -1078,7 +1078,7 @@ gnutls_x509_crl_get_number(gnutls_x509_crl_t crl, void *ret,
* Since: 2.8.0
**/
int
-gnutls_x509_crl_get_extension_oid(gnutls_x509_crl_t crl, int indx,
+gnutls_x509_crl_get_extension_oid(gnutls_x509_crl_t crl, unsigned indx,
void *oid, size_t * sizeof_oid)
{
int result;
@@ -1124,7 +1124,7 @@ gnutls_x509_crl_get_extension_oid(gnutls_x509_crl_t crl, int indx,
* Since: 2.8.0
**/
int
-gnutls_x509_crl_get_extension_info(gnutls_x509_crl_t crl, int indx,
+gnutls_x509_crl_get_extension_info(gnutls_x509_crl_t crl, unsigned indx,
void *oid, size_t * sizeof_oid,
unsigned int *critical)
{
@@ -1196,7 +1196,7 @@ gnutls_x509_crl_get_extension_info(gnutls_x509_crl_t crl, int indx,
* Since: 2.8.0
**/
int
-gnutls_x509_crl_get_extension_data(gnutls_x509_crl_t crl, int indx,
+gnutls_x509_crl_get_extension_data(gnutls_x509_crl_t crl, unsigned indx,
void *data, size_t * sizeof_data)
{
int result, len;
diff --git a/lib/x509/crq.c b/lib/x509/crq.c
index fb5987d301..73ff952f4a 100644
--- a/lib/x509/crq.c
+++ b/lib/x509/crq.c
@@ -326,7 +326,7 @@ int gnutls_x509_crq_get_dn2(gnutls_x509_crq_t crq, gnutls_datum_t * dn)
**/
int
gnutls_x509_crq_get_dn_by_oid(gnutls_x509_crq_t crq, const char *oid,
- int indx, unsigned int raw_flag,
+ unsigned indx, unsigned int raw_flag,
void *buf, size_t * buf_size)
{
gnutls_datum_t td;
@@ -363,7 +363,7 @@ gnutls_x509_crq_get_dn_by_oid(gnutls_x509_crq_t crq, const char *oid,
**/
int
gnutls_x509_crq_get_dn_oid(gnutls_x509_crq_t crq,
- int indx, void *oid, size_t * sizeof_oid)
+ unsigned indx, void *oid, size_t * sizeof_oid)
{
if (crq == NULL) {
gnutls_assert();
@@ -387,7 +387,7 @@ gnutls_x509_crq_get_dn_oid(gnutls_x509_crq_t crq,
*/
static int
parse_attribute(ASN1_TYPE asn1_struct,
- const char *attr_name, const char *given_oid, int indx,
+ const char *attr_name, const char *given_oid, unsigned indx,
int raw, gnutls_datum_t * out)
{
int k1, result;
@@ -583,7 +583,7 @@ add_attribute(ASN1_TYPE asn, const char *root, const char *attribute_id,
* index here starts from one.
*/
static int
-overwrite_attribute(ASN1_TYPE asn, const char *root, unsigned int indx,
+overwrite_attribute(ASN1_TYPE asn, const char *root, unsigned indx,
const gnutls_datum_t * ext_data)
{
char name[ASN1_MAX_NAME_SIZE], name2[ASN1_MAX_NAME_SIZE];
@@ -731,7 +731,7 @@ gnutls_x509_crq_set_attribute_by_oid(gnutls_x509_crq_t crq,
**/
int
gnutls_x509_crq_get_attribute_by_oid(gnutls_x509_crq_t crq,
- const char *oid, int indx, void *buf,
+ const char *oid, unsigned indx, void *buf,
size_t * buf_size)
{
int ret;
@@ -1345,7 +1345,7 @@ int gnutls_x509_crq_get_pk_oid(gnutls_x509_crq_t crq, char *oid, size_t *oid_siz
* Since: 2.8.0
**/
int
-gnutls_x509_crq_get_attribute_info(gnutls_x509_crq_t crq, int indx,
+gnutls_x509_crq_get_attribute_info(gnutls_x509_crq_t crq, unsigned indx,
void *oid, size_t * sizeof_oid)
{
int result;
@@ -1399,7 +1399,7 @@ gnutls_x509_crq_get_attribute_info(gnutls_x509_crq_t crq, int indx,
* Since: 2.8.0
**/
int
-gnutls_x509_crq_get_attribute_data(gnutls_x509_crq_t crq, int indx,
+gnutls_x509_crq_get_attribute_data(gnutls_x509_crq_t crq, unsigned indx,
void *data, size_t * sizeof_data)
{
int result, len;
@@ -1454,7 +1454,7 @@ gnutls_x509_crq_get_attribute_data(gnutls_x509_crq_t crq, int indx,
* Since: 2.8.0
**/
int
-gnutls_x509_crq_get_extension_info(gnutls_x509_crq_t crq, int indx,
+gnutls_x509_crq_get_extension_info(gnutls_x509_crq_t crq, unsigned indx,
void *oid, size_t * sizeof_oid,
unsigned int *critical)
{
@@ -1579,7 +1579,7 @@ gnutls_x509_crq_get_extension_info(gnutls_x509_crq_t crq, int indx,
* Since: 2.8.0
**/
int
-gnutls_x509_crq_get_extension_data(gnutls_x509_crq_t crq, int indx,
+gnutls_x509_crq_get_extension_data(gnutls_x509_crq_t crq, unsigned indx,
void *data, size_t * sizeof_data)
{
int ret;
@@ -1984,7 +1984,7 @@ gnutls_x509_crq_get_subject_alt_othername_oid(gnutls_x509_crq_t crq,
**/
int
gnutls_x509_crq_get_extension_by_oid(gnutls_x509_crq_t crq,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
void *buf, size_t * buf_size,
unsigned int *critical)
{
@@ -2043,7 +2043,7 @@ gnutls_x509_crq_get_extension_by_oid(gnutls_x509_crq_t crq,
**/
int
gnutls_x509_crq_get_extension_by_oid2(gnutls_x509_crq_t crq,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
gnutls_datum_t *output,
unsigned int *critical)
{
@@ -2426,7 +2426,7 @@ gnutls_x509_crq_set_key_usage(gnutls_x509_crq_t crq, unsigned int usage)
**/
int
gnutls_x509_crq_get_key_purpose_oid(gnutls_x509_crq_t crq,
- int indx, void *oid,
+ unsigned indx, void *oid,
size_t * sizeof_oid,
unsigned int *critical)
{
diff --git a/lib/x509/dn.c b/lib/x509/dn.c
index 5e6242698c..1f5bd0b25a 100644
--- a/lib/x509/dn.c
+++ b/lib/x509/dn.c
@@ -892,7 +892,7 @@ gnutls_x509_rdn_get(const gnutls_datum_t * idn,
**/
int
gnutls_x509_rdn_get_by_oid(const gnutls_datum_t * idn, const char *oid,
- int indx, unsigned int raw_flag,
+ unsigned indx, unsigned int raw_flag,
void *buf, size_t * buf_size)
{
int result;
@@ -948,7 +948,7 @@ gnutls_x509_rdn_get_by_oid(const gnutls_datum_t * idn, const char *oid,
**/
int
gnutls_x509_rdn_get_oid(const gnutls_datum_t * idn,
- int indx, void *buf, size_t * buf_size)
+ unsigned indx, void *buf, size_t * buf_size)
{
int result;
ASN1_TYPE dn = ASN1_TYPE_EMPTY;
diff --git a/lib/x509/pkcs12.c b/lib/x509/pkcs12.c
index 30275263b0..5b072dd8e6 100644
--- a/lib/x509/pkcs12.c
+++ b/lib/x509/pkcs12.c
@@ -369,7 +369,8 @@ _pkcs12_decode_safe_contents(const gnutls_datum_t * content,
int bag_type;
gnutls_datum_t attr_val;
gnutls_datum_t t;
- int count = 0, i, attributes, j;
+ int count = 0, attributes, j;
+ unsigned i;
/* Step 1. Extract the SEQUENCE.
*/
@@ -1234,7 +1235,7 @@ _pkcs12_encode_safe_contents(gnutls_pkcs12_bag_t bag, ASN1_TYPE * contents,
{
ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
int result;
- int i;
+ unsigned i;
const char *oid;
if (bag->element[0].type == GNUTLS_BAG_ENCRYPTED && enc) {
diff --git a/lib/x509/pkcs12_bag.c b/lib/x509/pkcs12_bag.c
index 5bf0da7eed..2717d18f9c 100644
--- a/lib/x509/pkcs12_bag.c
+++ b/lib/x509/pkcs12_bag.c
@@ -55,7 +55,7 @@ int gnutls_pkcs12_bag_init(gnutls_pkcs12_bag_t * bag)
static inline void _pkcs12_bag_free_data(gnutls_pkcs12_bag_t bag)
{
- int i;
+ unsigned i;
for (i = 0; i < bag->bag_elements; i++) {
_gnutls_free_datum(&bag->element[i].data);
@@ -94,7 +94,7 @@ void gnutls_pkcs12_bag_deinit(gnutls_pkcs12_bag_t bag)
* Returns: One of the #gnutls_pkcs12_bag_type_t enumerations.
**/
gnutls_pkcs12_bag_type_t
-gnutls_pkcs12_bag_get_type(gnutls_pkcs12_bag_t bag, int indx)
+gnutls_pkcs12_bag_get_type(gnutls_pkcs12_bag_t bag, unsigned indx)
{
if (bag == NULL) {
gnutls_assert();
@@ -139,7 +139,7 @@ int gnutls_pkcs12_bag_get_count(gnutls_pkcs12_bag_t bag)
* negative error value.
**/
int
-gnutls_pkcs12_bag_get_data(gnutls_pkcs12_bag_t bag, int indx,
+gnutls_pkcs12_bag_get_data(gnutls_pkcs12_bag_t bag, unsigned indx,
gnutls_datum_t * data)
{
if (bag == NULL) {
@@ -516,7 +516,7 @@ gnutls_pkcs12_bag_set_crl(gnutls_pkcs12_bag_t bag, gnutls_x509_crl_t crl)
* negative error value. or a negative error code on error.
**/
int
-gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag_t bag, int indx,
+gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag_t bag, unsigned indx,
const gnutls_datum_t * id)
{
int ret;
@@ -557,7 +557,7 @@ gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag_t bag, int indx,
* negative error value. or a negative error code on error.
**/
int
-gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag_t bag, int indx,
+gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag_t bag, unsigned indx,
gnutls_datum_t * id)
{
if (bag == NULL) {
@@ -590,7 +590,7 @@ gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag_t bag, int indx,
* negative error value. or a negative error code on error.
**/
int
-gnutls_pkcs12_bag_get_friendly_name(gnutls_pkcs12_bag_t bag, int indx,
+gnutls_pkcs12_bag_get_friendly_name(gnutls_pkcs12_bag_t bag, unsigned indx,
char **name)
{
if (bag == NULL) {
@@ -624,7 +624,7 @@ gnutls_pkcs12_bag_get_friendly_name(gnutls_pkcs12_bag_t bag, int indx,
* negative error value. or a negative error code on error.
**/
int
-gnutls_pkcs12_bag_set_friendly_name(gnutls_pkcs12_bag_t bag, int indx,
+gnutls_pkcs12_bag_set_friendly_name(gnutls_pkcs12_bag_t bag, unsigned indx,
const char *name)
{
if (bag == NULL) {
diff --git a/lib/x509/pkcs7.c b/lib/x509/pkcs7.c
index 532e691a54..15a1e17c25 100644
--- a/lib/x509/pkcs7.c
+++ b/lib/x509/pkcs7.c
@@ -290,7 +290,7 @@ gnutls_pkcs7_import(gnutls_pkcs7_t pkcs7, const gnutls_datum_t * data,
**/
int
gnutls_pkcs7_get_crt_raw2(gnutls_pkcs7_t pkcs7,
- int indx, gnutls_datum_t *cert)
+ unsigned indx, gnutls_datum_t *cert)
{
int result, len;
char root2[ASN1_MAX_NAME_SIZE];
@@ -372,7 +372,7 @@ gnutls_pkcs7_get_crt_raw2(gnutls_pkcs7_t pkcs7,
**/
int
gnutls_pkcs7_get_crt_raw(gnutls_pkcs7_t pkcs7,
- int indx, void *certificate,
+ unsigned indx, void *certificate,
size_t * certificate_size)
{
int ret;
@@ -1527,7 +1527,7 @@ int gnutls_pkcs7_delete_crt(gnutls_pkcs7_t pkcs7, int indx)
**/
int
gnutls_pkcs7_get_crl_raw2(gnutls_pkcs7_t pkcs7,
- int indx, gnutls_datum_t *crl)
+ unsigned indx, gnutls_datum_t *crl)
{
int result;
char root2[ASN1_MAX_NAME_SIZE];
@@ -1585,7 +1585,7 @@ gnutls_pkcs7_get_crl_raw2(gnutls_pkcs7_t pkcs7,
**/
int
gnutls_pkcs7_get_crl_raw(gnutls_pkcs7_t pkcs7,
- int indx, void *crl, size_t * crl_size)
+ unsigned indx, void *crl, size_t * crl_size)
{
int ret;
gnutls_datum_t tmp = {NULL, 0};
diff --git a/lib/x509/verify-high.c b/lib/x509/verify-high.c
index 2b90936c11..6aa732c7d9 100644
--- a/lib/x509/verify-high.c
+++ b/lib/x509/verify-high.c
@@ -560,10 +560,10 @@ int ret;
int
gnutls_x509_trust_list_remove_cas(gnutls_x509_trust_list_t list,
const gnutls_x509_crt_t * clist,
- int clist_size)
+ unsigned clist_size)
{
- int i, r = 0;
- unsigned j;
+ int r = 0;
+ unsigned j, i;
uint32_t hash;
for (i = 0; i < clist_size; i++) {
@@ -700,11 +700,11 @@ gnutls_x509_trust_list_add_named_crt(gnutls_x509_trust_list_t list,
int
gnutls_x509_trust_list_add_crls(gnutls_x509_trust_list_t list,
const gnutls_x509_crl_t * crl_list,
- int crl_size, unsigned int flags,
+ unsigned crl_size, unsigned int flags,
unsigned int verification_flags)
{
- int ret, i, j = 0;
- unsigned x;
+ int ret;
+ unsigned x, i, j = 0;
unsigned int vret = 0;
uint32_t hash;
diff --git a/lib/x509/verify.c b/lib/x509/verify.c
index 6ec63784cc..6439072ee2 100644
--- a/lib/x509/verify.c
+++ b/lib/x509/verify.c
@@ -786,7 +786,7 @@ verify_crt(gnutls_x509_crt_t cert,
* Returns: It will return true (1) if the given certificate is issued
* by the given issuer, and false (0) if not.
**/
-int
+unsigned
gnutls_x509_crt_check_issuer(gnutls_x509_crt_t cert,
gnutls_x509_crt_t issuer)
{
@@ -1233,14 +1233,15 @@ _gnutls_x509_verify_data(const mac_entry_st * me,
**/
int
gnutls_x509_crt_list_verify(const gnutls_x509_crt_t * cert_list,
- int cert_list_length,
+ unsigned cert_list_length,
const gnutls_x509_crt_t * CA_list,
- int CA_list_length,
+ unsigned CA_list_length,
const gnutls_x509_crl_t * CRL_list,
- int CRL_list_length, unsigned int flags,
+ unsigned CRL_list_length, unsigned int flags,
unsigned int *verify)
{
- int i, ret;
+ unsigned i;
+ int ret;
if (cert_list == NULL || cert_list_length == 0)
return GNUTLS_E_NO_CERTIFICATE_FOUND;
@@ -1288,7 +1289,7 @@ gnutls_x509_crt_list_verify(const gnutls_x509_crt_t * cert_list,
int
gnutls_x509_crt_verify(gnutls_x509_crt_t cert,
const gnutls_x509_crt_t * CA_list,
- int CA_list_length, unsigned int flags,
+ unsigned CA_list_length, unsigned int flags,
unsigned int *verify)
{
/* Verify certificate
@@ -1311,7 +1312,7 @@ gnutls_x509_crt_verify(gnutls_x509_crt_t cert,
* Returns: true (1) if the given CRL was issued by the given issuer,
* and false (0) if not.
**/
-int
+unsigned
gnutls_x509_crl_check_issuer(gnutls_x509_crl_t crl,
gnutls_x509_crt_t issuer)
{
@@ -1359,7 +1360,7 @@ find_crl_issuer(gnutls_x509_crl_t crl,
int
gnutls_x509_crl_verify(gnutls_x509_crl_t crl,
const gnutls_x509_crt_t * trusted_cas,
- int tcas_size, unsigned int flags,
+ unsigned tcas_size, unsigned int flags,
unsigned int *verify)
{
/* CRL is ignored for now */
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 7692522bde..160d806a92 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -560,7 +560,7 @@ gnutls_x509_crt_get_issuer_dn2(gnutls_x509_crt_t cert, gnutls_datum_t * dn)
**/
int
gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt_t cert,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
unsigned int raw_flag, void *buf,
size_t * buf_size)
{
@@ -602,7 +602,7 @@ gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt_t cert,
**/
int
gnutls_x509_crt_get_issuer_dn_oid(gnutls_x509_crt_t cert,
- int indx, void *oid, size_t * oid_size)
+ unsigned indx, void *oid, size_t * oid_size)
{
if (cert == NULL) {
gnutls_assert();
@@ -704,7 +704,7 @@ int gnutls_x509_crt_get_dn2(gnutls_x509_crt_t cert, gnutls_datum_t * dn)
**/
int
gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert, const char *oid,
- int indx, unsigned int raw_flag,
+ unsigned indx, unsigned int raw_flag,
void *buf, size_t * buf_size)
{
gnutls_datum_t td;
@@ -745,7 +745,7 @@ gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert, const char *oid,
**/
int
gnutls_x509_crt_get_dn_oid(gnutls_x509_crt_t cert,
- int indx, void *oid, size_t * oid_size)
+ unsigned indx, void *oid, size_t * oid_size)
{
if (cert == NULL) {
gnutls_assert();
@@ -2215,7 +2215,7 @@ void gnutls_x509_policy_release(struct gnutls_x509_policy_st *policy)
* Since: 3.1.5
**/
int
-gnutls_x509_crt_get_policy(gnutls_x509_crt_t crt, int indx,
+gnutls_x509_crt_get_policy(gnutls_x509_crt_t crt, unsigned indx,
struct gnutls_x509_policy_st *policy,
unsigned int *critical)
{
@@ -2291,7 +2291,7 @@ gnutls_x509_crt_get_policy(gnutls_x509_crt_t crt, int indx,
**/
int
gnutls_x509_crt_get_extension_by_oid(gnutls_x509_crt_t cert,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
void *buf, size_t * buf_size,
unsigned int *critical)
{
@@ -2352,7 +2352,7 @@ gnutls_x509_crt_get_extension_by_oid(gnutls_x509_crt_t cert,
**/
int
gnutls_x509_crt_get_extension_by_oid2(gnutls_x509_crt_t cert,
- const char *oid, int indx,
+ const char *oid, unsigned indx,
gnutls_datum_t *output,
unsigned int *critical)
{
@@ -2397,7 +2397,7 @@ gnutls_x509_crt_get_extension_by_oid2(gnutls_x509_crt_t cert,
* will be returned.
**/
int
-gnutls_x509_crt_get_extension_oid(gnutls_x509_crt_t cert, int indx,
+gnutls_x509_crt_get_extension_oid(gnutls_x509_crt_t cert, unsigned indx,
void *oid, size_t * oid_size)
{
int result;
@@ -2442,7 +2442,7 @@ gnutls_x509_crt_get_extension_oid(gnutls_x509_crt_t cert, int indx,
* will be returned.
**/
int
-gnutls_x509_crt_get_extension_info(gnutls_x509_crt_t cert, int indx,
+gnutls_x509_crt_get_extension_info(gnutls_x509_crt_t cert, unsigned indx,
void *oid, size_t * oid_size,
unsigned int *critical)
{
@@ -2512,7 +2512,7 @@ gnutls_x509_crt_get_extension_info(gnutls_x509_crt_t cert, int indx,
* will be returned.
**/
int
-gnutls_x509_crt_get_extension_data(gnutls_x509_crt_t cert, int indx,
+gnutls_x509_crt_get_extension_data(gnutls_x509_crt_t cert, unsigned indx,
void *data, size_t * sizeof_data)
{
int result, len;
@@ -3133,7 +3133,7 @@ _gnutls_x509_crt_check_revocation(gnutls_x509_crt_t cert,
int
gnutls_x509_crt_check_revocation(gnutls_x509_crt_t cert,
const gnutls_x509_crl_t * crl_list,
- int crl_list_length)
+ unsigned crl_list_length)
{
return _gnutls_x509_crt_check_revocation(cert, crl_list,
crl_list_length, NULL);
@@ -3301,7 +3301,7 @@ gnutls_x509_crt_get_crl_dist_points(gnutls_x509_crt_t cert,
**/
int
gnutls_x509_crt_get_key_purpose_oid(gnutls_x509_crt_t cert,
- int indx, void *oid, size_t * oid_size,
+ unsigned indx, void *oid, size_t * oid_size,
unsigned int *critical)
{
int ret;
diff --git a/lib/x509/x509_int.h b/lib/x509/x509_int.h
index b6f3e5fd96..e2e1b5e5cb 100644
--- a/lib/x509/x509_int.h
+++ b/lib/x509/x509_int.h
@@ -359,7 +359,7 @@ struct bag_element {
typedef struct gnutls_pkcs12_bag_int {
struct bag_element element[MAX_BAG_ELEMENTS];
- int bag_elements;
+ unsigned bag_elements;
} gnutls_pkcs12_bag_int;
#define BAG_PKCS8_KEY "1.2.840.113549.1.12.10.1.1"