From ac1622e0421afede179f08ba387cac2f84f8ed0e Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 5 Jun 2018 16:39:38 +0200 Subject: [PATCH] fix der_length_custom_type - incorrect length of length --- src/pk/asn1/der/custom_type/der_length_custom_type.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/custom_type/der_length_custom_type.c b/src/pk/asn1/der/custom_type/der_length_custom_type.c index 67b40b4ac..f1c41aaa4 100644 --- a/src/pk/asn1/der/custom_type/der_length_custom_type.c +++ b/src/pk/asn1/der/custom_type/der_length_custom_type.c @@ -190,7 +190,7 @@ int der_length_custom_type(const ltc_asn1_list *root, unsigned long *outlen, uns } } else { /* calc length of length */ - if ((err = der_length_asn1_length(y, &x)) != CRYPT_OK) { + if ((err = der_length_asn1_length(y - id_len, &x)) != CRYPT_OK) { goto LBL_ERR; } if (payloadlen != NULL) {