blob: 9982d03a72c1631375ebcc6b0d72977705ba00c9 [file] [log] [blame]
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +02001ASN.1 Write Octet String #0 (Empty string)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002mbedtls_asn1_write_octet_string:"":"0400":2:2
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +02003
4ASN.1 Write Octet String #1 (Large buffer)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02005mbedtls_asn1_write_octet_string:"AABBCC":"0403AABBCC":10:5
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +02006
7ASN.1 Write Octet String #2 (Buffer just fits)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02008mbedtls_asn1_write_octet_string:"AABBCC":"0403AABBCC":5:5
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +02009
10ASN.1 Write Octet String #3 (Buffer too small for tag)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020011mbedtls_asn1_write_octet_string:"AABBCC":"0403AABBCC":4:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +020012
13ASN.1 Write Octet String #4 (Buffer too small for len)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020014mbedtls_asn1_write_octet_string:"AABBCC":"0403AABBCC":3:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +020015
16ASN.1 Write Octet String #5 (Buffer too small for string)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020017mbedtls_asn1_write_octet_string:"AABBCC":"0403AABBCC":2:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +020018
19ASN.1 Write Octet String #6 (l = 128, large buffer)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020020mbedtls_asn1_write_octet_string:"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F":"048180000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F":140:131
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +020021
22ASN.1 Write Octet String #7 (l = 128, buffer just fits)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020023mbedtls_asn1_write_octet_string:"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F":"048180000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F":131:131
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +020024
25ASN.1 Write Octet String #8 (l = 128, buffer too small for tag)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020026mbedtls_asn1_write_octet_string:"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F":"":130:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +020027
28ASN.1 Write Octet String #9 (l = 128, buffer too small for len)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020029mbedtls_asn1_write_octet_string:"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F":"":129:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +020030
31ASN.1 Write Octet String #9 (l = 128, buffer too small for string)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020032mbedtls_asn1_write_octet_string:"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F":"":127:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Manuel Pégourié-Gonnardc22bb492014-05-29 17:16:45 +020033
34ASN.1 Write IA5 String #0 (Empty string)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020035mbedtls_asn1_write_ia5_string:"":"1600":2:2
Manuel Pégourié-Gonnardc22bb492014-05-29 17:16:45 +020036
37ASN.1 Write IA5 String #1 (Large buffer)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020038mbedtls_asn1_write_ia5_string:"ABC":"1603414243":10:5
Manuel Pégourié-Gonnardc22bb492014-05-29 17:16:45 +020039
40ASN.1 Write IA5 String #2 (Buffer just fits)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020041mbedtls_asn1_write_ia5_string:"ABC":"1603414243":5:5
Manuel Pégourié-Gonnardc22bb492014-05-29 17:16:45 +020042
43ASN.1 Write IA5 String #3 (Buffer too small for tag)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020044mbedtls_asn1_write_ia5_string:"ABC":"":4:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Manuel Pégourié-Gonnardc22bb492014-05-29 17:16:45 +020045
46ASN.1 Write IA5 String #4 (Buffer too small for len)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020047mbedtls_asn1_write_ia5_string:"ABC":"":3:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Manuel Pégourié-Gonnardc22bb492014-05-29 17:16:45 +020048
49ASN.1 Write IA5 String #5 (Buffer too small for string)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020050mbedtls_asn1_write_ia5_string:"ABC":"":2:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Paul Bakkere325db92016-07-14 10:27:36 +010051
52ASN.1 Write / Read Length #0 (Len = 0, short form)
Paul Bakker58bfb832016-07-14 11:02:31 +010053mbedtls_asn1_write_len:0:"00":1:1
Paul Bakkere325db92016-07-14 10:27:36 +010054
55ASN.1 Write / Read Length #1 (Len = 127, short form)
Paul Bakker58bfb832016-07-14 11:02:31 +010056mbedtls_asn1_write_len:127:"7F":1:1
Paul Bakkere325db92016-07-14 10:27:36 +010057
Paul Bakker58bfb832016-07-14 11:02:31 +010058ASN.1 Write / Read Length #2 (Len = 127, buffer too small)
59mbedtls_asn1_write_len:127:"7F":0:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Paul Bakkere325db92016-07-14 10:27:36 +010060
Paul Bakker58bfb832016-07-14 11:02:31 +010061ASN.1 Write / Read Length #3 (Len = 128, long form)
62mbedtls_asn1_write_len:128:"8180":2:2
Paul Bakkere325db92016-07-14 10:27:36 +010063
Paul Bakker58bfb832016-07-14 11:02:31 +010064ASN.1 Write / Read Length #4 (Len = 255, long form)
65mbedtls_asn1_write_len:255:"81FF":2:2
Paul Bakkere325db92016-07-14 10:27:36 +010066
Paul Bakker58bfb832016-07-14 11:02:31 +010067ASN.1 Write / Read Length #5 (Len = 255, buffer too small)
68mbedtls_asn1_write_len:255:"81FF":1:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Paul Bakkere325db92016-07-14 10:27:36 +010069
Paul Bakkerc7d6bd42016-07-14 11:39:56 +010070ASN.1 Write / Read Length #6 (Len = 258, byte order)
71mbedtls_asn1_write_len:258:"820102":3:3
Paul Bakker58bfb832016-07-14 11:02:31 +010072
Paul Bakkerc7d6bd42016-07-14 11:39:56 +010073ASN.1 Write / Read Length #7 (Len = 65535, long form)
Paul Bakker58bfb832016-07-14 11:02:31 +010074mbedtls_asn1_write_len:65535:"82FFFF":3:3
75
76ASN.1 Write / Read Length #8 (Len = 65535, buffer too small)
77mbedtls_asn1_write_len:65535:"82FFFF":2:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
78
Paul Bakkerc7d6bd42016-07-14 11:39:56 +010079ASN.1 Write / Read Length #9 (Len = 66051, byte order)
80mbedtls_asn1_write_len:66051:"83010203":4:4
81
82ASN.1 Write / Read Length #10 (Len = 16777215, long form)
83mbedtls_asn1_write_len:16777215:"83FFFFFF":4:4
84
85ASN.1 Write / Read Length #11 (Len = 16777215, buffer too small)
86mbedtls_asn1_write_len:16777215:"83FFFFFF":3:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
87
88ASN.1 Write / Read Length #12 (Len = 16909060, byte order)
89mbedtls_asn1_write_len:16909060:"8401020304":5:5
90
91ASN.1 Write / Read Length #12 (Len = 16909060, buffer too small)
92mbedtls_asn1_write_len:16909060:"8401020304":4:MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
Andres Amaya Garcia5d261632018-09-26 10:51:16 +010093
94ASN.1 Write Named Bitstring / Unused bits #0
95test_asn1_write_bitstrings:"FF":8:"030200FF":4:1
96
97ASN.1 Write Named Bitstring / Unused bits #1
98test_asn1_write_bitstrings:"FE":8:"030201FE":4:1
99
100ASN.1 Write Named Bitstring / Unused bits #2
101test_asn1_write_bitstrings:"FC":7:"030202FC":4:1
102
103ASN.1 Write Named Bitstring / Unused bits #3
104test_asn1_write_bitstrings:"F8":8:"030203F8":4:1
105
106ASN.1 Write Named Bitstring / Unused bits #4
107test_asn1_write_bitstrings:"F0":6:"030204F0":4:1
108
109ASN.1 Write Named Bitstring / Unused bits #5
110test_asn1_write_bitstrings:"E0":6:"030205E0":4:1
111
112ASN.1 Write Named Bitstring / Unused bits #6
113test_asn1_write_bitstrings:"C0":8:"030206C0":4:1
114
115ASN.1 Write Named Bitstring / Unused bits #7
116test_asn1_write_bitstrings:"80":8:"03020780":4:1
117
118ASN.1 Write Named Bitstring / Empty bitstring
119test_asn1_write_bitstrings:"00":7:"030100":3:1
120
121ASN.1 Write Named Bitstring / Empty bitstring (bits = 16)
122test_asn1_write_bitstrings:"0000":16:"030100":3:1
123
124ASN.1 Write Named Bitstring / Empty bitstring (bits = 24)
125test_asn1_write_bitstrings:"FFFFFF":0:"030100":3:1
126
127ASN.1 Write Named Bitstring / 15 trailing bits all unset
128test_asn1_write_bitstrings:"F88000":24:"030307F880":5:1
129
130ASN.1 Write Named Bitstring / 15 trailing bits all set
131test_asn1_write_bitstrings:"F8FFFF":9:"030307F880":5:1
132
133ASN.1 Write Bitstring / Unused bits #0
134test_asn1_write_bitstrings:"FF":8:"030200FF":4:0
135
136ASN.1 Write Bitstring / Unused bits #1
137test_asn1_write_bitstrings:"FF":7:"030201FE":4:0
138
139ASN.1 Write Bitstring / Unused bits #2
140test_asn1_write_bitstrings:"FF":6:"030202FC":4:0
141
142ASN.1 Write Bitstring / Unused bits #3
143test_asn1_write_bitstrings:"FF":5:"030203F8":4:0
144
145ASN.1 Write Bitstring / Unused bits #4
146test_asn1_write_bitstrings:"FF":4:"030204F0":4:0
147
148ASN.1 Write Bitstring / Unused bits #5
149test_asn1_write_bitstrings:"FF":3:"030205E0":4:0
150
151ASN.1 Write Bitstring / Unused bits #6
152test_asn1_write_bitstrings:"FF":2:"030206C0":4:0
153
154ASN.1 Write Bitstring / Unused bits #7
155test_asn1_write_bitstrings:"FF":1:"03020780":4:0
156
157ASN.1 Write Bitstring / 1 trailing bit (bits 15)
158test_asn1_write_bitstrings:"0003":15:"0303010002":5:0
159
160ASN.1 Write Bitstring / 0 bits
161test_asn1_write_bitstrings:"":0:"030100":3:0
162
163ASN.1 Write Bitstring / long string all bits unset except trailing bits
164test_asn1_write_bitstrings:"000000000007":45:"030703000000000000":9:0