Browse Source

Merge pull request #401 from libtom/pr/fix-der_length_custom_type

fix der_length_custom_type - incorrect length of length
karel-m 7 years ago
parent
commit
504396764e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/pk/asn1/der/custom_type/der_length_custom_type.c

+ 1 - 1
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 {
    } else {
       /* calc length of length */
       /* 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;
          goto LBL_ERR;
       }
       }
       if (payloadlen != NULL) {
       if (payloadlen != NULL) {