diff options
author | Dongsun Lee <ds73.lee@samsung.com> | 2019-12-10 09:12:25 +0900 |
---|---|---|
committer | Dongsun Lee <ds73.lee@samsung.com> | 2019-12-10 09:12:25 +0900 |
commit | 0677245c5babcc31b79b4dae955e6a76ff21ee03 (patch) | |
tree | b55f9ec039e963e42605e9e9bdc186354cf9df42 /lib/decoding.c | |
parent | 5c7e0aaf17a296535495e3431db6a86ad64064b3 (diff) | |
parent | dee455252ad321c660b411b4ecd65aa5e08f8fc1 (diff) | |
download | libtasn1-accepted/tizen_5.0_unified.tar.gz libtasn1-accepted/tizen_5.0_unified.tar.bz2 libtasn1-accepted/tizen_5.0_unified.zip |
Merge branch 'tizen' into tizen_5.0submit/tizen_5.0/20191210.074850accepted/tizen/5.0/unified/20191211.004425tizen_5.0accepted/tizen_5.0_unified
Change-Id: I40601b220984acd4fdeec050103cb65be8361514
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
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. * |