When cloning a certificate signed with ecdsa-with-SHA512, the script fails with the following error:
Unknow Hash Algorithm OID: 300a06082a8648ce3d040304
Steps to reproduce
- Obtain or generate an X.509 certificate with
Signature Algorithm: ecdsa-with-SHA512.
- Run: ./clone-cert.sh path/to/cert.pem
- Observe the error output.
Expected behavior
The script should correctly detect the hash algorithm (SHA512) and proceed with the cloning process.
Actual behavior
The script exits with:
Unknow Hash Algorithm OID: 300a06082a8648ce3d040304
Root cause
The function oid() in clone-cert.sh does not include a mapping for the OID representing ecdsa-with-SHA512.
Proposed fix
Add the missing mapping in the oid() function:
"300a06082a8648ce3d040304") echo sha512
;;#ecdsa-with-SHA512
When cloning a certificate signed with
ecdsa-with-SHA512, the script fails with the following error:Steps to reproduce
Signature Algorithm: ecdsa-with-SHA512.Expected behavior
The script should correctly detect the hash algorithm (SHA512) and proceed with the cloning process.
Actual behavior
The script exits with:
Unknow Hash Algorithm OID: 300a06082a8648ce3d040304
Root cause
The function
oid()inclone-cert.shdoes not include a mapping for the OID representing ecdsa-with-SHA512.Proposed fix
Add the missing mapping in the
oid()function: