Mercurial > dropbear
comparison libtomcrypt/src/pk/asn1/der/octet/der_encode_octet_string.c @ 1511:5916af64acd4 fuzz
merge from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 19:29:51 +0800 |
parents | 6dba84798cd5 |
children |
comparison
equal
deleted
inserted
replaced
1457:32f990cc96b1 | 1511:5916af64acd4 |
---|---|
3 * LibTomCrypt is a library that provides various cryptographic | 3 * LibTomCrypt is a library that provides various cryptographic |
4 * algorithms in a highly modular and flexible manner. | 4 * algorithms in a highly modular and flexible manner. |
5 * | 5 * |
6 * The library is free for all purposes without any express | 6 * The library is free for all purposes without any express |
7 * guarantee it works. | 7 * guarantee it works. |
8 * | |
9 * Tom St Denis, [email protected], http://libtom.org | |
10 */ | 8 */ |
11 #include "tomcrypt.h" | 9 #include "tomcrypt.h" |
12 | 10 |
13 /** | 11 /** |
14 @file der_encode_octet_string.c | 12 @file der_encode_octet_string.c |
36 LTC_ARGCHK(out != NULL); | 34 LTC_ARGCHK(out != NULL); |
37 LTC_ARGCHK(outlen != NULL); | 35 LTC_ARGCHK(outlen != NULL); |
38 | 36 |
39 /* get the size */ | 37 /* get the size */ |
40 if ((err = der_length_octet_string(inlen, &len)) != CRYPT_OK) { | 38 if ((err = der_length_octet_string(inlen, &len)) != CRYPT_OK) { |
41 return err; | 39 return err; |
42 } | 40 } |
43 | 41 |
44 /* too big? */ | 42 /* too big? */ |
45 if (len > *outlen) { | 43 if (len > *outlen) { |
46 *outlen = len; | 44 *outlen = len; |
79 return CRYPT_OK; | 77 return CRYPT_OK; |
80 } | 78 } |
81 | 79 |
82 #endif | 80 #endif |
83 | 81 |
84 /* $Source$ */ | 82 /* ref: $Format:%D$ */ |
85 /* $Revision$ */ | 83 /* git commit: $Format:%H$ */ |
86 /* $Date$ */ | 84 /* commit time: $Format:%ai$ */ |