diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-08-30 17:42:21 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-08-30 17:42:21 +0200 |
commit | ac86423bab8b724e91ba0d0d320c38d6857cfd9f (patch) | |
tree | 223265886aa202c47bf85997e2ed9d86bbe8eed5 | |
parent | 51a2e5f73c0d211a8a5243cd6d84451f26b39837 (diff) | |
download | gnutls-ac86423bab8b724e91ba0d0d320c38d6857cfd9f.tar.gz |
corrected sign type errors for integers.
-rw-r--r-- | lib/includes/gnutls/x509.h | 8 | ||||
-rw-r--r-- | lib/x509/crl.c | 2 | ||||
-rw-r--r-- | lib/x509/crq.c | 16 | ||||
-rw-r--r-- | lib/x509/extensions.c | 6 | ||||
-rw-r--r-- | lib/x509/key_decode.c | 2 | ||||
-rw-r--r-- | lib/x509/output.c | 6 | ||||
-rw-r--r-- | lib/x509/privkey.c | 2 | ||||
-rw-r--r-- | lib/x509/x509.c | 20 | ||||
-rw-r--r-- | lib/x509/x509_int.h | 2 | ||||
-rw-r--r-- | libextra/gnutls_openssl.c | 6 | ||||
-rw-r--r-- | src/crywrap/crywrap.c | 2 |
11 files changed, 38 insertions, 34 deletions
diff --git a/lib/includes/gnutls/x509.h b/lib/includes/gnutls/x509.h index 0a0617ba33..35a8b94dd4 100644 --- a/lib/includes/gnutls/x509.h +++ b/lib/includes/gnutls/x509.h @@ -244,7 +244,7 @@ extern "C" unsigned int *critical); int gnutls_x509_crt_get_basic_constraints (gnutls_x509_crt_t cert, unsigned int *critical, - int *ca, int *pathlen); + unsigned int *ca, int *pathlen); /* The key_usage flags are defined in gnutls.h. They are the * GNUTLS_KEY_* definitions. @@ -275,7 +275,7 @@ extern "C" /* Read extensions by sequence number. */ int gnutls_x509_crt_get_extension_info (gnutls_x509_crt_t cert, int indx, void *oid, size_t * sizeof_oid, - int *critical); + unsigned int *critical); int gnutls_x509_crt_get_extension_data (gnutls_x509_crt_t cert, int indx, void *data, size_t * sizeof_data); @@ -818,7 +818,7 @@ extern "C" void *data, size_t * sizeof_data); int gnutls_x509_crq_get_extension_info (gnutls_x509_crq_t crq, int indx, void *oid, size_t * sizeof_oid, - int *critical); + unsigned int *critical); int gnutls_x509_crq_get_attribute_data (gnutls_x509_crq_t crq, int indx, void *data, size_t * sizeof_data); int gnutls_x509_crq_get_attribute_info (gnutls_x509_crq_t crq, int indx, @@ -838,7 +838,7 @@ extern "C" unsigned int *critical); int gnutls_x509_crq_get_basic_constraints (gnutls_x509_crq_t crq, unsigned int *critical, - int *ca, int *pathlen); + unsigned int *ca, int *pathlen); int gnutls_x509_crq_get_subject_alt_name (gnutls_x509_crq_t crq, unsigned int seq, void *ret, size_t * ret_size, diff --git a/lib/x509/crl.c b/lib/x509/crl.c index 6a54cf9d23..d8056d3cf6 100644 --- a/lib/x509/crl.c +++ b/lib/x509/crl.c @@ -328,7 +328,7 @@ gnutls_x509_crl_get_signature (gnutls_x509_crl_t crl, { int result; int bits; - unsigned int len; + int len; if (crl == NULL) { diff --git a/lib/x509/crq.c b/lib/x509/crq.c index 9d80027ce5..ba7a7c6f6d 100644 --- a/lib/x509/crq.c +++ b/lib/x509/crq.c @@ -1275,7 +1275,7 @@ gnutls_x509_crq_get_attribute_data (gnutls_x509_crq_t crq, int indx, int gnutls_x509_crq_get_extension_info (gnutls_x509_crq_t crq, int indx, void *oid, size_t * sizeof_oid, - int *critical) + unsigned int *critical) { int result; char str_critical[10]; @@ -1564,10 +1564,10 @@ gnutls_x509_crq_get_key_usage (gnutls_x509_crq_t crq, int gnutls_x509_crq_get_basic_constraints (gnutls_x509_crq_t crq, unsigned int *critical, - int *ca, int *pathlen) + unsigned int *ca, int *pathlen) { int result; - int tmp_ca; + unsigned int tmp_ca; opaque buf[256]; size_t buf_size = sizeof (buf); @@ -2340,7 +2340,7 @@ gnutls_x509_crq_get_key_id (gnutls_x509_crq_t crq, unsigned int flags, unsigned char *output_data, size_t * output_data_size) { - int pk, result = 0; + int pk, result = 0, len; gnutls_datum_t pubkey; if (crq == NULL) @@ -2375,14 +2375,14 @@ gnutls_x509_crq_get_key_id (gnutls_x509_crq_t crq, unsigned int flags, pubkey.size = 0; result = asn1_der_coding (crq->crq, "certificationRequestInfo.subjectPKInfo", NULL, - &pubkey.size, NULL); + &len, NULL); if (result != ASN1_MEM_ERROR) { gnutls_assert (); return _gnutls_asn2err (result); } - pubkey.data = gnutls_malloc (pubkey.size); + pubkey.data = gnutls_malloc (len); if (pubkey.data == NULL) { gnutls_assert (); @@ -2391,7 +2391,7 @@ gnutls_x509_crq_get_key_id (gnutls_x509_crq_t crq, unsigned int flags, result = asn1_der_coding (crq->crq, "certificationRequestInfo.subjectPKInfo", - pubkey.data, &pubkey.size, NULL); + pubkey.data, &len, NULL); if (result != ASN1_SUCCESS) { gnutls_assert (); @@ -2399,6 +2399,8 @@ gnutls_x509_crq_get_key_id (gnutls_x509_crq_t crq, unsigned int flags, return _gnutls_asn2err (result); } + pubkey.size = len; + result = gnutls_fingerprint (GNUTLS_DIG_SHA1, &pubkey, output_data, output_data_size); diff --git a/lib/x509/extensions.c b/lib/x509/extensions.c index 00fc57f0be..025c38c846 100644 --- a/lib/x509/extensions.c +++ b/lib/x509/extensions.c @@ -660,7 +660,7 @@ _gnutls_x509_ext_extract_keyUsage (uint16_t * keyUsage, /* extract the basicConstraints from the DER encoded extension */ int -_gnutls_x509_ext_extract_basicConstraints (int *CA, +_gnutls_x509_ext_extract_basicConstraints (unsigned int *CA, int *pathLenConstraint, opaque * extnValue, int extnValueLen) @@ -687,7 +687,7 @@ _gnutls_x509_ext_extract_basicConstraints (int *CA, if (pathLenConstraint) { result = _gnutls_x509_read_uint (ext, "pathLenConstraint", - pathLenConstraint); + (unsigned int*)pathLenConstraint); if (result == GNUTLS_E_ASN1_ELEMENT_NOT_FOUND) *pathLenConstraint = -1; else if (result != GNUTLS_E_SUCCESS) @@ -1247,7 +1247,7 @@ _gnutls_x509_ext_extract_proxyCertInfo (int *pathLenConstraint, if (pathLenConstraint) { result = _gnutls_x509_read_uint (ext, "pCPathLenConstraint", - pathLenConstraint); + (unsigned int*)pathLenConstraint); if (result == GNUTLS_E_ASN1_ELEMENT_NOT_FOUND) *pathLenConstraint = -1; else if (result != GNUTLS_E_SUCCESS) diff --git a/lib/x509/key_decode.c b/lib/x509/key_decode.c index f3541d65d5..0690a49bcc 100644 --- a/lib/x509/key_decode.c +++ b/lib/x509/key_decode.c @@ -186,7 +186,7 @@ _gnutls_x509_read_ecc_params (opaque * der, int dersize, gnutls_pk_params_st * p int ret; ASN1_TYPE spk = ASN1_TYPE_EMPTY; char oid[MAX_OID_SIZE]; - unsigned int oid_size; + int oid_size; if ((ret = asn1_create_element (_gnutls_get_gnutls_asn (), "GNUTLS.ECParameters", &spk)) != ASN1_SUCCESS) diff --git a/lib/x509/output.c b/lib/x509/output.c index e2985d7e03..39b0ea7b52 100644 --- a/lib/x509/output.c +++ b/lib/x509/output.c @@ -785,7 +785,7 @@ print_extensions (gnutls_buffer_st * str, const char *prefix, int type, { char oid[MAX_OID_SIZE] = ""; size_t sizeof_oid = sizeof (oid); - int critical; + unsigned int critical; if (type == TYPE_CRT) err = gnutls_x509_crt_get_extension_info (cert.crt, i, @@ -1440,7 +1440,7 @@ print_oneline (gnutls_buffer_st * str, gnutls_x509_crt_t cert) /* Key algorithm and size. */ { - int bits; + unsigned int bits; const char *name = gnutls_pk_algorithm_get_name (gnutls_x509_crt_get_pk_algorithm (cert, &bits)); if (name == NULL) @@ -1701,7 +1701,7 @@ print_crl (gnutls_buffer_st * str, gnutls_x509_crl_t crl, int notsigned) { char oid[MAX_OID_SIZE] = ""; size_t sizeof_oid = sizeof (oid); - int critical; + unsigned int critical; err = gnutls_x509_crl_get_extension_info (crl, i, oid, &sizeof_oid, diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c index ba5e2345fb..31762dae3d 100644 --- a/lib/x509/privkey.c +++ b/lib/x509/privkey.c @@ -240,7 +240,7 @@ _gnutls_privkey_decode_ecc_key (const gnutls_datum_t * raw_key, ASN1_TYPE pkey_asn; unsigned int version; char oid[MAX_OID_SIZE]; - unsigned int oid_size; + int oid_size; gnutls_datum out; gnutls_pk_params_init(&pkey->params); diff --git a/lib/x509/x509.c b/lib/x509/x509.c index 5011c586f9..606d44fd6b 100644 --- a/lib/x509/x509.c +++ b/lib/x509/x509.c @@ -903,7 +903,7 @@ _gnutls_parse_general_name (ASN1_TYPE src, const char *src_name, int seq, void *name, size_t * name_size, unsigned int *ret_type, int othername_oid) { - unsigned int len; + int len; char nptr[ASN1_MAX_NAME_SIZE]; int result; opaque choice_type[128]; @@ -1422,11 +1422,11 @@ gnutls_x509_crt_get_issuer_alt_othername_oid (gnutls_x509_crt_t cert, int gnutls_x509_crt_get_basic_constraints (gnutls_x509_crt_t cert, unsigned int *critical, - int *ca, int *pathlen) + unsigned int *ca, int *pathlen) { int result; gnutls_datum_t basicConstraints; - int tmp_ca; + unsigned int tmp_ca; if (cert == NULL) { @@ -1485,7 +1485,8 @@ gnutls_x509_crt_get_basic_constraints (gnutls_x509_crt_t cert, int gnutls_x509_crt_get_ca_status (gnutls_x509_crt_t cert, unsigned int *critical) { - int ca, pathlen; + int pathlen; + unsigned int ca; return gnutls_x509_crt_get_basic_constraints (cert, critical, &ca, &pathlen); } @@ -1742,7 +1743,7 @@ gnutls_x509_crt_get_extension_oid (gnutls_x509_crt_t cert, int indx, int gnutls_x509_crt_get_extension_info (gnutls_x509_crt_t cert, int indx, void *oid, size_t * oid_size, - int *critical) + unsigned int *critical) { int result; char str_critical[10]; @@ -2282,7 +2283,7 @@ gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt, unsigned int flags, unsigned char *output_data, size_t * output_data_size) { - int pk, result = 0; + int pk, result = 0, len; gnutls_datum_t pubkey; if (crt == NULL) @@ -2320,14 +2321,14 @@ gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt, unsigned int flags, */ pubkey.size = 0; result = asn1_der_coding (crt->cert, "tbsCertificate.subjectPublicKeyInfo", - NULL, &pubkey.size, NULL); + NULL, &len, NULL); if (result != ASN1_MEM_ERROR) { gnutls_assert (); return _gnutls_asn2err (result); } - pubkey.data = gnutls_malloc (pubkey.size); + pubkey.data = gnutls_malloc (len); if (pubkey.data == NULL) { gnutls_assert (); @@ -2335,7 +2336,7 @@ gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt, unsigned int flags, } result = asn1_der_coding (crt->cert, "tbsCertificate.subjectPublicKeyInfo", - pubkey.data, &pubkey.size, NULL); + pubkey.data, &len, NULL); if (result != ASN1_SUCCESS) { gnutls_assert (); @@ -2343,6 +2344,7 @@ gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt, unsigned int flags, return _gnutls_asn2err (result); } + pubkey.size = len; result = gnutls_fingerprint (GNUTLS_DIG_SHA1, &pubkey, output_data, output_data_size); diff --git a/lib/x509/x509_int.h b/lib/x509/x509_int.h index 57d7ceaf8b..c5d466a699 100644 --- a/lib/x509/x509_int.h +++ b/lib/x509/x509_int.h @@ -215,7 +215,7 @@ int _gnutls_x509_crt_get_extension_oid (gnutls_x509_crt_t cert, size_t * ret_size); int _gnutls_x509_ext_extract_keyUsage (uint16_t * keyUsage, opaque * extnValue, int extnValueLen); -int _gnutls_x509_ext_extract_basicConstraints (int *CA, +int _gnutls_x509_ext_extract_basicConstraints (unsigned int *CA, int *pathLenConstraint, opaque * extnValue, int extnValueLen); diff --git a/libextra/gnutls_openssl.c b/libextra/gnutls_openssl.c index 88752a953e..14121da9a8 100644 --- a/libextra/gnutls_openssl.c +++ b/libextra/gnutls_openssl.c @@ -344,7 +344,7 @@ const X509 * SSL_get_peer_certificate (SSL * ssl) { const gnutls_datum_t *cert_list; - int cert_list_size = 0; + unsigned int cert_list_size = 0; cert_list = gnutls_certificate_get_peers (ssl->gnutls_state, &cert_list_size); @@ -358,7 +358,7 @@ int SSL_connect (SSL * ssl) { X509_STORE_CTX *store; - int cert_list_size = 0; + unsigned int cert_list_size = 0; int err; char x_priority[256]; /* take options into account before connecting */ @@ -407,7 +407,7 @@ int SSL_accept (SSL * ssl) { X509_STORE_CTX *store; - int cert_list_size = 0; + unsigned int cert_list_size = 0; int err; char x_priority[256]; /* take options into account before connecting */ diff --git a/src/crywrap/crywrap.c b/src/crywrap/crywrap.c index 1c51d632f0..da41f854d8 100644 --- a/src/crywrap/crywrap.c +++ b/src/crywrap/crywrap.c @@ -188,7 +188,7 @@ static void _crywrap_sigchld_handler (int sig) { pid_t child; -unsigned int status; +int status; while ((child = waitpid (-1, &status, WNOHANG)) > (pid_t) 0) signal (sig, _crywrap_sigchld_handler); |