diff options
author | Pawel Kowalski <p.kowalski2@partner.samsung.com> | 2019-08-28 14:31:23 +0200 |
---|---|---|
committer | Pawel Kowalski <p.kowalski2@partner.samsung.com> | 2019-08-28 16:56:31 +0200 |
commit | dee455252ad321c660b411b4ecd65aa5e08f8fc1 (patch) | |
tree | b55f9ec039e963e42605e9e9bdc186354cf9df42 /lib/decoding.c | |
parent | 5c7e0aaf17a296535495e3431db6a86ad64064b3 (diff) | |
parent | 26bea900a531662c6028ecc06f4adea825658434 (diff) | |
download | libtasn1-dee455252ad321c660b411b4ecd65aa5e08f8fc1.tar.gz libtasn1-dee455252ad321c660b411b4ecd65aa5e08f8fc1.tar.bz2 libtasn1-dee455252ad321c660b411b4ecd65aa5e08f8fc1.zip |
Merge tag 'upstream/4.14' into tizentizen_6.5.m2_releasetizen_6.0.m2_releasetizen_5.5.m2_releasesubmit/tizen_6.5/20211028.163501submit/tizen_6.0_hotfix/20201103.115102submit/tizen_6.0_hotfix/20201102.192902submit/tizen_6.0/20201029.205502submit/tizen_5.5_wearable_hotfix/20201026.184307submit/tizen_5.5_mobile_hotfix/20201026.185107submit/tizen_5.5/20191031.000007submit/tizen/20190904.070216submit/tizen/20190829.061506accepted/tizen/unified/20190904.110630accepted/tizen/6.5/unified/20211029.014057accepted/tizen/6.0/unified/hotfix/20201103.050702accepted/tizen/6.0/unified/hotfix/20201102.234932accepted/tizen/6.0/unified/20201030.110146accepted/tizen/5.5/unified/wearable/hotfix/20201027.100357accepted/tizen/5.5/unified/mobile/hotfix/20201027.074057accepted/tizen/5.5/unified/20191031.011500tizen_6.5tizen_6.0_hotfixtizen_6.0tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixtizen_5.5accepted/tizen_6.5_unifiedaccepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unifiedaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unified
Change-Id: I6d4b47b2072db8e7c45daa6e269e2f0cc6f54a7f
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. * |