diff options
| author | David Howells <dhowells@redhat.com> | 2012-12-04 20:25:30 -0500 |
|---|---|---|
| committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-13 21:36:42 -0500 |
| commit | 99cca91e370ab9224755365dda98b78eb5a5417f (patch) | |
| tree | 03a7b0db1f061657a7498fc2c46b616bf877ae0b /lib | |
| parent | facc0a6bd494ce21e31b34fc355ecf702518272b (diff) | |
ASN.1: Use the ASN1_LONG_TAG and ASN1_INDEFINITE_LENGTH constants
Use the ASN1_LONG_TAG and ASN1_INDEFINITE_LENGTH constants in the ASN.1
general decoder instead of the equivalent numbers.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/asn1_decoder.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c index de2c8b5a715b..7bd2188ed939 100644 --- a/lib/asn1_decoder.c +++ b/lib/asn1_decoder.c | |||
| @@ -81,7 +81,7 @@ next_tag: | |||
| 81 | goto next_tag; | 81 | goto next_tag; |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | if (unlikely((tag & 0x1f) == 0x1f)) { | 84 | if (unlikely((tag & 0x1f) == ASN1_LONG_TAG)) { |
| 85 | do { | 85 | do { |
| 86 | if (unlikely(datalen - dp < 2)) | 86 | if (unlikely(datalen - dp < 2)) |
| 87 | goto data_overrun_error; | 87 | goto data_overrun_error; |
| @@ -96,7 +96,7 @@ next_tag: | |||
| 96 | goto next_tag; | 96 | goto next_tag; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | if (unlikely(len == 0x80)) { | 99 | if (unlikely(len == ASN1_INDEFINITE_LENGTH)) { |
| 100 | /* Indefinite length */ | 100 | /* Indefinite length */ |
| 101 | if (unlikely((tag & ASN1_CONS_BIT) == ASN1_PRIM << 5)) | 101 | if (unlikely((tag & ASN1_CONS_BIT) == ASN1_PRIM << 5)) |
| 102 | goto indefinite_len_primitive; | 102 | goto indefinite_len_primitive; |
| @@ -222,7 +222,7 @@ next_op: | |||
| 222 | if (unlikely(dp >= datalen - 1)) | 222 | if (unlikely(dp >= datalen - 1)) |
| 223 | goto data_overrun_error; | 223 | goto data_overrun_error; |
| 224 | tag = data[dp++]; | 224 | tag = data[dp++]; |
| 225 | if (unlikely((tag & 0x1f) == 0x1f)) | 225 | if (unlikely((tag & 0x1f) == ASN1_LONG_TAG)) |
| 226 | goto long_tag_not_supported; | 226 | goto long_tag_not_supported; |
| 227 | 227 | ||
| 228 | if (op & ASN1_OP_MATCH__ANY) { | 228 | if (op & ASN1_OP_MATCH__ANY) { |
| @@ -254,7 +254,7 @@ next_op: | |||
| 254 | 254 | ||
| 255 | len = data[dp++]; | 255 | len = data[dp++]; |
| 256 | if (len > 0x7f) { | 256 | if (len > 0x7f) { |
| 257 | if (unlikely(len == 0x80)) { | 257 | if (unlikely(len == ASN1_INDEFINITE_LENGTH)) { |
| 258 | /* Indefinite length */ | 258 | /* Indefinite length */ |
| 259 | if (unlikely(!(tag & ASN1_CONS_BIT))) | 259 | if (unlikely(!(tag & ASN1_CONS_BIT))) |
| 260 | goto indefinite_len_primitive; | 260 | goto indefinite_len_primitive; |
