Commit ec39cb3
authored
[tool-openssl] basic asn1parse support (#2882)
### Issues:
Resolves P342458791
### Description of changes:
Adds basic support for `openssl asn1parse` with the following arguments:
```
-in <inputFile>
-inform (PEM | DER)
```
The behavior of the command will default to OpenSSL's `-strictpem` flag
behavior which was an optional feature. We can revisit if this
determined to be required in order to relax the input restriction for
valid PEM blocks.
### Call-outs:
The original asn1parse function used `ASN1_dump` rather then
`ASN1_parse`, under the hood they are the same function, except that
`ASN1_dump` can be given a flag to indicate that unknown data should be
hex dumped out. As our BIO hexdump functions doesn't match OpenSSL's the
output would be slightly different. For now I've opted to not support
the `-dump` flag for the CLI, and chose to only expose `ASN1_parse` in
the library. That way we could come back and add `-dump` and `ASN1_dump`
with proper output without worrying about backwards compatibility
concerns.
### Testing:
* Added a series of corpus files for some BER and DER encodings (the
asn1parse tool / library components due allow some BER features e.g.
indefinite length encoding).
* Used DER corpus files to seed a fuzzer for testing the `ASN1_parse`
library function.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.1 parent 653cc0a commit ec39cb3
File tree
703 files changed
+1491
-1
lines changed- crypto/asn1
- fuzz
- asn1parse_corpus
- include/openssl
- tool-openssl
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
703 files changed
+1491
-1
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Binary file not shown.
0 commit comments