diff options
Diffstat (limited to 'lib/decoding.c')
-rw-r--r-- | lib/decoding.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/decoding.c b/lib/decoding.c index 05dc236..56f9582 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -306,7 +306,7 @@ asn1_get_octet_der (const unsigned char *der, int der_len, } -/*- +/*- * _asn1_get_time_der: * @type: %ASN1_ETYPE_GENERALIZED_TIME or %ASN1_ETYPE_UTC_TIME * @der: DER data to decode containing the time @@ -391,7 +391,7 @@ _asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int *r } /** - * asn1_get_objectid_der: + * asn1_get_object_id_der: * @der: DER data to decode containing the OBJECT IDENTIFIER * @der_len: Length of DER data to decode. * @ret_len: Output variable containing the length of the DER data. @@ -1049,7 +1049,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (ris == ASN1_SUCCESS) ris = - extract_tag_der_recursive (p, der + counter, ider_len, + extract_tag_der_recursive (p, der + counter, ider_len, &tag_len, &inner_tag_len, flags); if (ris != ASN1_SUCCESS) @@ -1414,8 +1414,8 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, break; case ASN1_ETYPE_ANY: /* Check indefinite lenth method in an EXPLICIT TAG */ - - if (!(flags & ASN1_DECODE_FLAG_STRICT_DER) && (p->type & CONST_TAG) && + + if (!(flags & ASN1_DECODE_FLAG_STRICT_DER) && (p->type & CONST_TAG) && tag_len == 2 && (der[counter - 1] == 0x80)) indefinite = 1; else @@ -1555,7 +1555,7 @@ cleanup: * * Fill the structure *@element with values of a DER encoding * string. The structure must just be created with function - * asn1_create_element(). + * asn1_create_element(). * * Note that the *@element variable is provided as a pointer for * historical reasons. @@ -1695,13 +1695,14 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int ider_len, * depending on DER decoding. **/ int -asn1_expand_any_defined_by (asn1_node definitions, asn1_node * element) +asn1_expand_any_defined_by (asn1_node_const definitions, asn1_node * element) { - char name[2 * ASN1_MAX_NAME_SIZE + 1], + char name[2 * ASN1_MAX_NAME_SIZE + 2], value[ASN1_MAX_NAME_SIZE]; int retCode = ASN1_SUCCESS, result; int len, len2, len3; - asn1_node p, p2, p3, aux = NULL; + asn1_node_const p2; + asn1_node p, p3, aux = NULL; char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; const char *definitionsName; @@ -1923,13 +1924,14 @@ asn1_expand_any_defined_by (asn1_node definitions, asn1_node * element) * use for expansion, or other errors depending on DER decoding. **/ int -asn1_expand_octet_string (asn1_node definitions, asn1_node * element, +asn1_expand_octet_string (asn1_node_const definitions, asn1_node * element, const char *octetName, const char *objectName) { char name[2 * ASN1_MAX_NAME_SIZE + 1], value[ASN1_MAX_NAME_SIZE]; int retCode = ASN1_SUCCESS, result; int len, len2, len3; - asn1_node p2, aux = NULL; + asn1_node_const p2; + asn1_node aux = NULL; asn1_node octetNode = NULL, objectNode = NULL; char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; @@ -2159,7 +2161,7 @@ static int append(uint8_t **dst, unsigned *dst_size, const unsigned char *src, u * @ber_len: the total length occupied by BER (may be %NULL) * @have_tag: whether a DER tag is included * - * Decodes a BER encoded type. The output is an allocated value + * Decodes a BER encoded type. The output is an allocated value * of the data. This decodes BER STRINGS only. Other types are * decoded as DER. * @@ -2361,7 +2363,7 @@ cleanup: * @str_len: the length of the data * @ber_len: the total length occupied by BER (may be %NULL) * - * Decodes a BER encoded type. The output is an allocated value + * Decodes a BER encoded type. The output is an allocated value * of the data. This decodes BER STRINGS only. Other types are * decoded as DER. * |