summaryrefslogtreecommitdiff
path: root/gck
diff options
context:
space:
mode:
authorGregor Riepl <onitake@gmail.com>2019-11-26 22:43:47 +0100
committerGregor Riepl <onitake@gmail.com>2019-11-26 22:43:47 +0100
commitb5b9ba30a5bf2699ff7fe574c3a1e8b79e1586ae (patch)
treeccbc9e8af9ee766dc9a050305760b969d63bbd0b /gck
parent152c9c361550693ae8b5fc8bfadfcd0abbbeb6be (diff)
downloadgcr-b5b9ba30a5bf2699ff7fe574c3a1e8b79e1586ae.tar.gz
Use attribute_get_ulong instead of pointer aliasing
Diffstat (limited to 'gck')
-rw-r--r--gck/gck-attributes.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gck/gck-attributes.c b/gck/gck-attributes.c
index d0b9401..bb57ffe 100644
--- a/gck/gck-attributes.c
+++ b/gck/gck-attributes.c
@@ -2814,13 +2814,13 @@ _gck_format_attributes (GString *output,
if (attr->length == GCK_INVALID) {
g_string_append_printf (output, " (-1) INVALID");
} else if (_gck_attribute_is_ulong_of_type (attr, CKA_CLASS)) {
- _gck_format_class (output, *((CK_OBJECT_CLASS_PTR)attr->value));
+ _gck_format_class (output, (CK_OBJECT_CLASS) gck_attribute_get_ulong(attr));
} else if (_gck_attribute_is_ulong_of_type (attr, CKA_X_ASSERTION_TYPE)) {
- _gck_format_assertion_type (output, *((CK_X_ASSERTION_TYPE *)attr->value));
+ _gck_format_assertion_type (output, (CK_X_ASSERTION_TYPE) gck_attribute_get_ulong(attr));
} else if (_gck_attribute_is_ulong_of_type (attr, CKA_CERTIFICATE_TYPE)) {
- _gck_format_certificate_type (output, *((CK_CERTIFICATE_TYPE *)attr->value));
+ _gck_format_certificate_type (output, (CK_CERTIFICATE_TYPE) gck_attribute_get_ulong(attr));
} else if (_gck_attribute_is_ulong_of_type (attr, CKA_KEY_TYPE)) {
- _gck_format_key_type (output, *((CK_KEY_TYPE *)attr->value));
+ _gck_format_key_type (output, (CK_KEY_TYPE) gck_attribute_get_ulong(attr));
} else if (_gck_attribute_is_sensitive (attr)) {
g_string_append_printf (output, " (%lu) NOT-PRINTED", attr->length);
} else {