summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-06-05 15:50:19 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-06-05 15:50:19 +0200
commit37762160fe2c6580a24f52cd223e6d166e31f25e (patch)
tree51c72c5dbab9f36b4d0ddd2187f734c0c7732a9d
parenta8d85774a06f9ba35141fe28b15abaf9c83f7ceb (diff)
downloadlibtasn1-37762160fe2c6580a24f52cd223e6d166e31f25e.tar.gz
libtasn1-37762160fe2c6580a24f52cd223e6d166e31f25e.tar.bz2
libtasn1-37762160fe2c6580a24f52cd223e6d166e31f25e.zip
Document that ider and ider_len are optional in asn1_der_decoding_startEnd()
-rw-r--r--lib/decoding.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/decoding.c b/lib/decoding.c
index 5f5d55b..f3ac191 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -1538,6 +1538,9 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
* One example is the sequence "tbsCertificate" inside an X509
* certificate.
*
+ * Note that since libtasn1 3.7 the @ider and @ider_len parameters
+ * can be omitted, if the element is already decoded using asn1_der_decoding().
+ *
* Returns: %ASN1_SUCCESS if DER encoding OK, %ASN1_ELEMENT_NOT_FOUND
* if ELEMENT is %asn1_node EMPTY or @name_element is not a valid
* element, %ASN1_TAG_ERROR or %ASN1_DER_ERROR if the der encoding
@@ -1565,6 +1568,9 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int ider_len,
if (*start == 0 && *end == 0)
{
+ if (ider == NULL || ider_len == 0)
+ return ASN1_GENERIC_ERROR;
+
/* it seems asn1_der_decoding() wasn't called before. Do it now */
result = asn1_der_decoding (&node, ider, ider_len, NULL);
if (result != ASN1_SUCCESS)