diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-03-04 22:50:12 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-03-13 19:34:31 +0100 |
commit | 627774dea5e3202f4e6a1ab7ef32b6c07d0f4ec9 (patch) | |
tree | dd1083c1730ca438235afe21995fe0aa144e8dcd /lib | |
parent | 5549db25e83d9cf7529af3df8e99c0fad1fd1c50 (diff) | |
download | libtasn1-627774dea5e3202f4e6a1ab7ef32b6c07d0f4ec9.tar.gz libtasn1-627774dea5e3202f4e6a1ab7ef32b6c07d0f4ec9.tar.bz2 libtasn1-627774dea5e3202f4e6a1ab7ef32b6c07d0f4ec9.zip |
API is based on integers instead of long to prevent errors in systems where sizeof(int)!=sizeof(long)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/coding.c | 2 | ||||
-rw-r--r-- | lib/decoding.c | 6 | ||||
-rw-r--r-- | lib/libtasn1.h | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/coding.c b/lib/coding.c index 8b72eba..a1896d5 100644 --- a/lib/coding.c +++ b/lib/coding.c @@ -68,7 +68,7 @@ _asn1_error_description_value_not_found (ASN1_TYPE node, * The @ans buffer is pre-allocated and must have room for the output. **/ void -asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len) +asn1_length_der (unsigned int len, unsigned char *ans, int *ans_len) { int k; unsigned char temp[SIZEOF_UNSIGNED_LONG_INT]; diff --git a/lib/decoding.c b/lib/decoding.c index ed144f0..e5590f2 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -56,10 +56,10 @@ _asn1_error_description_tag_error (ASN1_TYPE node, char *ErrorDescription) * Returns: Return the decoded length value, or -1 on indefinite * length, or -2 when the value was too big. **/ -signed long +signed int asn1_get_length_der (const unsigned char *der, int der_len, int *len) { - signed long ans; + signed int ans; int k, punt; *len = 0; @@ -172,7 +172,7 @@ asn1_get_tag_der (const unsigned char *der, int der_len, * * Since: 2.0 **/ -signed long +signed int asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len) { int ret; diff --git a/lib/libtasn1.h b/lib/libtasn1.h index 289fb57..f18327f 100644 --- a/lib/libtasn1.h +++ b/lib/libtasn1.h @@ -261,14 +261,14 @@ extern "C" int *ret_len, unsigned char *str, int str_size, int *bit_len); - extern ASN1_API signed long + extern ASN1_API signed int asn1_get_length_der (const unsigned char *der, int der_len, int *len); - extern ASN1_API signed long + extern ASN1_API signed int asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len); extern ASN1_API void - asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len); + asn1_length_der (unsigned int len, unsigned char *ans, int *ans_len); /* Other utility functions. */ |