summaryrefslogtreecommitdiff
path: root/lib/openpgp
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-15 16:02:29 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-21 01:05:59 +0100
commit37c8eaecbdaebc62aa4c2e8671fb366d20f9bbe8 (patch)
tree97b62330682aa8a6912d8413088addbf52579c67 /lib/openpgp
parent99ad4c6b2ab76d386be76daed0c509e62d6334c7 (diff)
downloadgnutls-37c8eaecbdaebc62aa4c2e8671fb366d20f9bbe8.tar.gz
Fixed signed/unsigned warnings.
Dropped opaque type (replaced with uint8_t)
Diffstat (limited to 'lib/openpgp')
-rw-r--r--lib/openpgp/extras.c2
-rw-r--r--lib/openpgp/gnutls_openpgp.c12
-rw-r--r--lib/openpgp/gnutls_openpgp.h4
-rw-r--r--lib/openpgp/output.c11
-rw-r--r--lib/openpgp/pgp.c2
-rw-r--r--lib/openpgp/privkey.c6
6 files changed, 19 insertions, 18 deletions
diff --git a/lib/openpgp/extras.c b/lib/openpgp/extras.c
index 5cc51c39bd..37f5b0786a 100644
--- a/lib/openpgp/extras.c
+++ b/lib/openpgp/extras.c
@@ -127,7 +127,7 @@ gnutls_openpgp_keyring_import (gnutls_openpgp_keyring_t keyring,
cdk_error_t err;
cdk_stream_t input = NULL;
size_t raw_len = 0;
- opaque *raw_data = NULL;
+ uint8_t *raw_data = NULL;
if (data->data == NULL || data->size == 0)
{
diff --git a/lib/openpgp/gnutls_openpgp.c b/lib/openpgp/gnutls_openpgp.c
index af266e665d..b6cc7976de 100644
--- a/lib/openpgp/gnutls_openpgp.c
+++ b/lib/openpgp/gnutls_openpgp.c
@@ -183,7 +183,7 @@ cleanup:
int
gnutls_openpgp_get_key (gnutls_datum_t * key,
gnutls_openpgp_keyring_t keyring, key_attr_t by,
- opaque * pattern)
+ uint8_t * pattern)
{
cdk_kbnode_t knode = NULL;
unsigned long keyid[2];
@@ -453,7 +453,7 @@ gnutls_certificate_set_openpgp_key_file2 (gnutls_certificate_credentials_t
return GNUTLS_E_FILE_ERROR;
}
- cert.data = read_binary_file (certfile, &size);
+ cert.data = (void*)read_binary_file (certfile, &size);
cert.size = (unsigned int) size;
if (cert.data == NULL)
{
@@ -461,7 +461,7 @@ gnutls_certificate_set_openpgp_key_file2 (gnutls_certificate_credentials_t
return GNUTLS_E_FILE_ERROR;
}
- key.data = read_binary_file (keyfile, &size);
+ key.data = (void*)read_binary_file (keyfile, &size);
key.size = (unsigned int) size;
if (key.data == NULL)
{
@@ -550,7 +550,7 @@ gnutls_certificate_set_openpgp_keyring_file (gnutls_certificate_credentials_t c,
return GNUTLS_E_INVALID_REQUEST;
}
- ring.data = read_binary_file (file, &size);
+ ring.data = (void*)read_binary_file (file, &size);
ring.size = (unsigned int) size;
if (ring.data == NULL)
{
@@ -584,7 +584,7 @@ gnutls_certificate_set_openpgp_keyring_file (gnutls_certificate_credentials_t c,
**/
int
gnutls_certificate_set_openpgp_keyring_mem (gnutls_certificate_credentials_t
- c, const opaque * data,
+ c, const uint8_t * data,
size_t dlen,
gnutls_openpgp_crt_fmt_t format)
{
@@ -632,7 +632,7 @@ gnutls_certificate_set_openpgp_keyring_mem (gnutls_certificate_credentials_t
int
_gnutls_openpgp_request_key (gnutls_session_t session, gnutls_datum_t * ret,
const gnutls_certificate_credentials_t cred,
- opaque * key_fpr, int key_fpr_size)
+ uint8_t * key_fpr, int key_fpr_size)
{
int rc = 0;
diff --git a/lib/openpgp/gnutls_openpgp.h b/lib/openpgp/gnutls_openpgp.h
index b5616b8a58..59ff2abeba 100644
--- a/lib/openpgp/gnutls_openpgp.h
+++ b/lib/openpgp/gnutls_openpgp.h
@@ -22,7 +22,7 @@ int gnutls_openpgp_count_key_names (const gnutls_datum_t * cert);
int gnutls_openpgp_get_key (gnutls_datum_t * key,
gnutls_openpgp_keyring_t keyring,
- key_attr_t by, opaque * pattern);
+ key_attr_t by, uint8_t * pattern);
/* internal */
int
@@ -32,7 +32,7 @@ int
_gnutls_openpgp_request_key (gnutls_session_t,
gnutls_datum_t * ret,
const gnutls_certificate_credentials_t cred,
- opaque * key_fpr, int key_fpr_size);
+ uint8_t * key_fpr, int key_fpr_size);
int _gnutls_openpgp_verify_key (const gnutls_certificate_credentials_t,
const gnutls_datum_t * cert_list,
diff --git a/lib/openpgp/output.c b/lib/openpgp/output.c
index 4f25eee248..1f1b73223f 100644
--- a/lib/openpgp/output.c
+++ b/lib/openpgp/output.c
@@ -98,7 +98,7 @@ print_key_id (gnutls_buffer_st * str, gnutls_openpgp_crt_t cert, int idx)
static void
print_key_fingerprint (gnutls_buffer_st * str, gnutls_openpgp_crt_t cert)
{
- char fpr[128];
+ uint8_t fpr[128];
size_t fpr_size = sizeof (fpr);
int err;
const char* name;
@@ -500,6 +500,7 @@ gnutls_openpgp_crt_print (gnutls_openpgp_crt_t cert,
gnutls_datum_t * out)
{
gnutls_buffer_st str;
+ int ret;
_gnutls_buffer_init (&str);
@@ -514,8 +515,8 @@ gnutls_openpgp_crt_print (gnutls_openpgp_crt_t cert,
_gnutls_buffer_append_data (&str, "\0", 1);
- out->data = str.data;
- out->size = strlen (str.data);
-
- return 0;
+ ret = _gnutls_buffer_to_datum( &str, out);
+ if (out->size > 0) out->size--;
+
+ return ret;
}
diff --git a/lib/openpgp/pgp.c b/lib/openpgp/pgp.c
index ef6bd6bc94..7ace55da5f 100644
--- a/lib/openpgp/pgp.c
+++ b/lib/openpgp/pgp.c
@@ -1073,7 +1073,7 @@ _gnutls_read_pgp_mpi (cdk_packet_t pkt, unsigned int priv, size_t idx,
bigint_t * m)
{
size_t buf_size = 512;
- opaque *buf = gnutls_malloc (buf_size);
+ uint8_t *buf = gnutls_malloc (buf_size);
int err;
unsigned int max_pub_params = 0;
diff --git a/lib/openpgp/privkey.c b/lib/openpgp/privkey.c
index 6fafe32663..9be87b0206 100644
--- a/lib/openpgp/privkey.c
+++ b/lib/openpgp/privkey.c
@@ -87,7 +87,7 @@ _gnutls_openpgp_privkey_cpy (gnutls_openpgp_privkey_t dest, gnutls_openpgp_privk
{
int ret;
size_t raw_size=0;
- opaque *der;
+ uint8_t *der;
gnutls_datum_t tmp;
ret = gnutls_openpgp_privkey_export (src, GNUTLS_OPENPGP_FMT_RAW, NULL, 0, NULL, &raw_size);
@@ -730,8 +730,8 @@ _gnutls_openpgp_privkey_get_mpis (gnutls_openpgp_privkey_t pkey,
uint32_t * keyid /*[2] */ ,
gnutls_pk_params_st * params)
{
- int result, i;
- int pk_algorithm;
+ int result;
+ unsigned int i, pk_algorithm;
cdk_packet_t pkt;
gnutls_pk_params_init(params);