diff options
author | Stef Walter <stefw@collabora.co.uk> | 2011-10-04 18:15:37 +0200 |
---|---|---|
committer | Stef Walter <stefw@collabora.co.uk> | 2011-10-04 18:15:37 +0200 |
commit | acc403e77774308cfd7ba7cab3d65a7799d2ff47 (patch) | |
tree | 8a2fb02819d1d983c7f14e9cf32e5abf6c666312 /egg/egg-asn1x.h | |
parent | cf3d2e4ba298e5ee8c1bda80e2a71d47ef635a89 (diff) | |
download | gcr-acc403e77774308cfd7ba7cab3d65a7799d2ff47.tar.gz |
egg: Fix parsing of unsigned integers in DER
* When the unsigned integer had a high bit set, we would store/parse
it incorrectly. We have to force these numbers to be unsigned so
we prefix/strip an extra zero byte on the front.
* Also make accessing raw and usg numbers in DER not have to copy
the value, since these are often sensitive.
Diffstat (limited to 'egg/egg-asn1x.h')
-rw-r--r-- | egg/egg-asn1x.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/egg/egg-asn1x.h b/egg/egg-asn1x.h index b6c8427..3f74655 100644 --- a/egg/egg-asn1x.h +++ b/egg/egg-asn1x.h @@ -102,8 +102,7 @@ gboolean egg_asn1x_get_integer_as_ulong (GNode *node, gboolean egg_asn1x_set_integer_as_ulong (GNode *node, gulong value); -gpointer egg_asn1x_get_integer_as_raw (GNode *node, - EggAllocator allocator, +gconstpointer egg_asn1x_get_integer_as_raw (GNode *node, gsize *n_data); gboolean egg_asn1x_set_integer_as_raw (GNode *node, @@ -111,6 +110,14 @@ gboolean egg_asn1x_set_integer_as_raw (GNode *node, gsize n_data, GDestroyNotify destroy); +gconstpointer egg_asn1x_get_integer_as_usg (GNode *node, + gsize *n_data); + +gboolean egg_asn1x_set_integer_as_usg (GNode *node, + gconstpointer data, + gsize n_data, + GDestroyNotify destroy); + gconstpointer egg_asn1x_get_raw_value (GNode *node, gsize *n_content); |