diff options
author | Simon Josefsson <simon@josefsson.org> | 2008-11-04 10:02:22 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2008-11-04 10:02:22 +0100 |
commit | ccb5787914a65f76a38e6b8ae5f1bdf50dd05373 (patch) | |
tree | 461b3078df10c9ba75e9f46080222f1b8a5fcdc0 | |
parent | 1265e52768ed02708fb4d9332957ec31bd13e97e (diff) | |
download | libtasn1-ccb5787914a65f76a38e6b8ae5f1bdf50dd05373.tar.gz |
Doc fix. Fix asn1_get_length_ber signature.
-rw-r--r-- | lib/decoding.c | 18 | ||||
-rw-r--r-- | lib/libtasn1.h | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/decoding.c b/lib/decoding.c index 7e9aa30..6a1c979 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -57,8 +57,6 @@ _asn1_error_description_tag_error (node_asn * node, char *ErrorDescription) * * Return value: Return the decoded length value, or -1 on indefinite * length, or -2 when the value was too big. - * - * Since: 2.0 **/ signed long asn1_get_length_der (const unsigned char *der, int der_len, int *len) @@ -168,28 +166,30 @@ asn1_get_tag_der (const unsigned char *der, int der_len, * @ber_len: Length of BER data to decode. * @len: Output variable containing the length of the BER length field. * - * Extract a length field from BER data. + * Extract a length field from BER data. The difference to + * asn1_get_length_der() is that this function will return a length + * even if the value has indefinite encoding. * * Return value: Return the decoded length value, or negative value - * when the value was too big. The difference with asn1_get_length_der() - * is that it will return length even if the value has indefinite encoding. + * when the value was too big. * + * Since: 2.0 **/ -long +signed long asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len) { int ret; long err; ret = asn1_get_length_der( ber, ber_len, len); - if (ret == -1) + if (ret == -1) { /* indefinite length method */ ret = ber_len; err = _asn1_get_indefinite_length_string (ber+1, &ret); if (err != ASN1_SUCCESS) - return -3; + return -3; } - + return ret; } diff --git a/lib/libtasn1.h b/lib/libtasn1.h index 29b3d28..15d863c 100644 --- a/lib/libtasn1.h +++ b/lib/libtasn1.h @@ -244,7 +244,7 @@ extern "C" signed long asn1_get_length_der (const unsigned char *der, int der_len, int *len); - long asn1_get_length_ber (const unsigned char *ber, int ber_len, + signed long asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len); void asn1_length_der (unsigned long int len, unsigned char *ans, |