Skip to content

Commit 4a74be3

Browse files
author
Ben Taylor
committed
Add code optimisation in asn1write
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
1 parent e5fdb3f commit 4a74be3

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

utilities/asn1write.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ int mbedtls_asn1_write_integer(unsigned char **p,
403403
size_t integer_length)
404404
{
405405

406-
int asn1_frame_size = 0;
407406
unsigned int number_of_leading_zeros = 0;
408407
size_t output_buffer_size = (*p-start);
409408
const unsigned char *integer_start = NULL;
@@ -454,12 +453,6 @@ int mbedtls_asn1_write_integer(unsigned char **p,
454453
}
455454
}
456455

457-
asn1_frame_size =
458-
mbedtls_asn1_write_len_and_tag(p, start, integer_length, MBEDTLS_ASN1_INTEGER);
459-
if (asn1_frame_size < 0) {
460-
return asn1_frame_size;//TC4 mbedtls_asn1_write_len_and_tag failed.
461-
}
462-
463-
return asn1_frame_size;
456+
return mbedtls_asn1_write_len_and_tag(p, start, integer_length, MBEDTLS_ASN1_INTEGER);
464457
}
465458
#endif /* MBEDTLS_ASN1_WRITE_C */

0 commit comments

Comments
 (0)