gchq / gchq/CyberChef

Bug report: Cant use Parse X.509 Certificate on certificates signed with ED25519 signatures: `unsupported PKCS#8 public key hex`

Open
#2,005 0 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
35.8k
Forks
4.1k
Avg merge
2d 26m
Merged PRs (30d)
33

Description

**Describe the bug**
Using the _Parse X.509 Certificate_ recipe to parse a certificate that was generated using ED25519 signatures doesn't work and returns a `unsupported PKCS#8 public key hex` error.

**To Reproduce**
Sample input: [Click Here](https://gchq.github.io/CyberChef/#recipe=Parse_X.509_certificate('PEM')&input=LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJDRENCdXdJVUdXNzh6dzBPTDBHcHRKaSsrYTkxZEJhN0RzUXdCUVlESzJWd01DY3hDekFKQmdOVkJBWVQKQWtSRk1SZ3dGZ1lEVlFRRERBOTNkM2N1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGt3TXpNeE1UYzFNVEl5V2hjTgpNakV3TWpJNE1UYzFNVEl5V2pBbk1Rc3dDUVlEVlFRR0V3SkVSVEVZTUJZR0ExVUVBd3dQZDNkM0xtVjRZVzF3CmJHVXVZMjl0TUNvd0JRWURLMlZ3QXlFQUs4N2cwYjhDQzFlQTVtdktYdDl1ZXpad0pZV0V5Zzc0WTB4VFpFa3EKQ2N3d0JRWURLMlZ3QTBFQUlJdS9hYTNRdHIzSUU1dG8vbnZXVlk5eTNjaXdHNURuQTcwWDNBTFVoRnMrVTVhTAp0Zlk4c05UMU5nNzJodCtVQndCeXV6ZTIwVXNMOXFNc21rblFDQT09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0)

This certificate parses fine with OpenSSL, i.e. `openssl x509 -in cert_goes_here.pem -text -noout`:

```
Certificate:
Data:
Version: 1 (0x0)
Serial Number:
19:6e:fc:cf:0d:0e:2f:41:a9:b4:98:be:f9:af:75:74:16:bb:0e:c4
Signature Algorithm: ED25519
Issuer: C=DE, CN=www.example.com
Validity
Not Before: Mar 31 17:51:22 2019 GMT
Not After : Feb 28 17:51:22 2021 GMT
Subject: C=DE, CN=www.example.com
Subject Public Key Info:
Public Key Algorithm: ED25519
ED25519 Public-Key:
pub:
2b:ce:e0:d1:bf:02:0b:57:80:e6:6b:ca:5e:df:6e:
7b:36:70:25:85:84:ca:0e:f8:63:4c:53:64:49:2a:
09:cc
Signature Algorithm: ED25519
Signature Value:
20:8b:bf:69:ad:d0:b6:bd:c8:13:9b:68:fe:7b:d6:55:8f:72:
dd:c8:b0:1b:90:e7:03:bd:17:dc:02:d4:84:5b:3e:53:96:8b:
b5:f6:3c:b0:d4:f5:36:0e:f6:86:df:94:07:00:72:bb:37:b6:
d1:4b:0b:f6:a3:2c:9a:49:d0:08
```

**Expected behaviour**
The cert will be parsed and information about its contents will be displayed.

**Screenshots**
N/A

**Desktop (if relevant, please complete the following information):**
- OS: Arch Linux
- Browser: Firefox `136.0.3`
- CyberChef version: `10.19.4`

**Additional context**
N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.