diff options
author | Stefan Walter <stefw@src.gnome.org> | 2009-02-02 12:58:29 +0000 |
---|---|---|
committer | Stefan Walter <stefw@src.gnome.org> | 2009-02-02 12:58:29 +0000 |
commit | cb4189d901f9e2bd945d24d9baefb81ea7eb4387 (patch) | |
tree | a429e3d96a398a56b4e924fbd75db08ff8b16d68 /daemon | |
parent | a76840a8140a19a0817cce3cba73c3b71ac9be8b (diff) |
Fix more size problems when using constants with varargs. Fixes bug
* daemon/pk/gkr-pk-cert.c:
* daemon/pk/gkr-pk-import.c:
* daemon/pk/gkr-pk-object.c:
* daemon/pk/gkr-pk-privkey.c:
* daemon/pk/gkr-pk-pubkey.c:
* daemon/pk/gkr-pk-util.c:
* gp11/gp11-attributes.c:
* gp11/gp11-object.c:
* gp11/tests/unit-test-gp11-attributes.c:
* gp11/tests/unit-test-gp11-object.c:
* gp11/tests/unit-test-gp11-session.c:
* pkcs11/gck/gck-attributes.c:
* pkcs11/gck/gck-private-key.c:
* pkcs11/gck/gck-public-key.c:
* pkcs11/gck/gck-session.c:
* pkcs11/ssh-agent/gck-ssh-agent-ops.c:
* pkcs11/ssh-agent/gck-ssh-agent-proto.c:
* tools/gkr-tool-import.c: Fix more size problems when using constants
with varargs. Fixes bug #569736. Research by Christophe Fergeau
svn path=/trunk/; revision=1492
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/pk/gkr-pk-cert.c | 2 | ||||
-rw-r--r-- | daemon/pk/gkr-pk-import.c | 2 | ||||
-rw-r--r-- | daemon/pk/gkr-pk-object.c | 2 | ||||
-rw-r--r-- | daemon/pk/gkr-pk-privkey.c | 6 | ||||
-rw-r--r-- | daemon/pk/gkr-pk-pubkey.c | 6 | ||||
-rw-r--r-- | daemon/pk/gkr-pk-util.c | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/daemon/pk/gkr-pk-cert.c b/daemon/pk/gkr-pk-cert.c index cb2e8cfa..96bdc3db 100644 --- a/daemon/pk/gkr-pk-cert.c +++ b/daemon/pk/gkr-pk-cert.c @@ -719,7 +719,7 @@ gkr_pk_cert_create (GkrPkManager* manager, GArray* array, return CKR_ATTRIBUTE_VALUE_INVALID; /* All the attributes that we used up */ - gkr_pk_attributes_consume (array, CKA_CERTIFICATE_TYPE, CKA_VALUE, -1); + gkr_pk_attributes_consume (array, CKA_CERTIFICATE_TYPE, CKA_VALUE, G_MAXULONG); *object = GKR_PK_OBJECT (gkr_pk_cert_new (manager, 0, asn)); return CKR_OK; diff --git a/daemon/pk/gkr-pk-import.c b/daemon/pk/gkr-pk-import.c index 128d96bc..e1882e5c 100644 --- a/daemon/pk/gkr-pk-import.c +++ b/daemon/pk/gkr-pk-import.c @@ -522,7 +522,7 @@ gkr_pk_import_create (GkrPkManager* manager, GkrPkSession *session, /* All the attributes that we used up */ gkr_pk_attributes_consume (array, CKA_VALUE, CKA_GNOME_IMPORT_TOKEN, - CKA_GNOME_IMPORT_LABEL, -1); + CKA_GNOME_IMPORT_LABEL, G_MAXULONG); return CKR_OK; } diff --git a/daemon/pk/gkr-pk-object.c b/daemon/pk/gkr-pk-object.c index 9cc33185..14e3c205 100644 --- a/daemon/pk/gkr-pk-object.c +++ b/daemon/pk/gkr-pk-object.c @@ -539,7 +539,7 @@ gkr_pk_object_create (GkrPkSession *session, g_return_val_if_fail (*object != NULL, CKR_GENERAL_ERROR); /* Mark these bits as used */ - gkr_pk_attributes_consume (attrs, CKA_CLASS, CKA_TOKEN, -1); + gkr_pk_attributes_consume (attrs, CKA_CLASS, CKA_TOKEN, G_MAXULONG); /* * Check that all the remaining attributes are either already diff --git a/daemon/pk/gkr-pk-privkey.c b/daemon/pk/gkr-pk-privkey.c index e616a2a2..379e6b20 100644 --- a/daemon/pk/gkr-pk-privkey.c +++ b/daemon/pk/gkr-pk-privkey.c @@ -200,7 +200,7 @@ create_rsa_private (GArray *attrs, gcry_sexp_t *skey) gkr_pk_attributes_consume (attrs, CKA_MODULUS, CKA_PUBLIC_EXPONENT, CKA_PRIVATE_EXPONENT, CKA_PRIME_1, CKA_PRIME_2, - CKA_EXPONENT_1, CKA_EXPONENT_2, CKA_COEFFICIENT, -1); + CKA_EXPONENT_1, CKA_EXPONENT_2, CKA_COEFFICIENT, G_MAXULONG); ret = CKR_OK; done: @@ -249,7 +249,7 @@ create_dsa_private (GArray *attrs, gcry_sexp_t *skey) } gkr_pk_attributes_consume (attrs, CKA_PRIME, CKA_SUBPRIME, - CKA_BASE, CKA_VALUE, -1); + CKA_BASE, CKA_VALUE, G_MAXULONG); ret = CKR_OK; done: @@ -642,7 +642,7 @@ gkr_pk_privkey_create (GkrPkManager* manager, GArray* array, if (!gkr_pk_attributes_ulong (array, CKA_KEY_TYPE, &type)) return CKR_TEMPLATE_INCOMPLETE; - gkr_pk_attributes_consume (array, CKA_KEY_TYPE, -1); + gkr_pk_attributes_consume (array, CKA_KEY_TYPE, G_MAXULONG); switch (type) { case CKK_RSA: diff --git a/daemon/pk/gkr-pk-pubkey.c b/daemon/pk/gkr-pk-pubkey.c index 9c0702e3..b712d96a 100644 --- a/daemon/pk/gkr-pk-pubkey.c +++ b/daemon/pk/gkr-pk-pubkey.c @@ -152,7 +152,7 @@ create_rsa_public (GArray *attrs, gcry_sexp_t *skey) goto done; } - gkr_pk_attributes_consume (attrs, CKA_MODULUS, CKA_PUBLIC_EXPONENT, -1); + gkr_pk_attributes_consume (attrs, CKA_MODULUS, CKA_PUBLIC_EXPONENT, G_MAXULONG); ret = CKR_OK; done: @@ -191,7 +191,7 @@ create_dsa_public (GArray *attrs, gcry_sexp_t *skey) } gkr_pk_attributes_consume (attrs, CKA_PRIME, CKA_SUBPRIME, - CKA_BASE, CKA_VALUE, -1); + CKA_BASE, CKA_VALUE, G_MAXULONG); ret = CKR_OK; done: @@ -549,7 +549,7 @@ gkr_pk_pubkey_create (GkrPkManager* manager, GArray* array, if (!gkr_pk_attributes_ulong (array, CKA_KEY_TYPE, &type)) return CKR_TEMPLATE_INCOMPLETE; - gkr_pk_attributes_consume (array, CKA_KEY_TYPE, -1); + gkr_pk_attributes_consume (array, CKA_KEY_TYPE, G_MAXULONG); switch (type) { case CKK_RSA: diff --git a/daemon/pk/gkr-pk-util.c b/daemon/pk/gkr-pk-util.c index b552a47a..7eb7d3ad 100644 --- a/daemon/pk/gkr-pk-util.c +++ b/daemon/pk/gkr-pk-util.c @@ -491,7 +491,7 @@ gkr_pk_attributes_consume (GArray *attrs, ...) /* Convert the var args into an array */ types = g_array_new (FALSE, TRUE, sizeof (CK_ATTRIBUTE_TYPE)); va_start (va, attrs); - while ((type = va_arg (va, CK_ATTRIBUTE_TYPE)) != (CK_ULONG)-1) + while ((type = va_arg (va, CK_ATTRIBUTE_TYPE)) != G_MAXULONG) g_array_append_val (types, type); va_end (va); |