mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
Merge branch 'bug-x509-sig'
This commit is contained in:
commit
d53da4cfb5
1 changed files with 9 additions and 2 deletions
|
@ -124,10 +124,17 @@ const PublicKey = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Signature fields
|
// Signature fields
|
||||||
if (r.ASN1HEX.dump(certSig).indexOf("SEQUENCE") === 0) { // DSA or ECDSA
|
let breakoutSig = false;
|
||||||
|
try {
|
||||||
|
breakoutSig = r.ASN1HEX.dump(certSig).indexOf("SEQUENCE") === 0;
|
||||||
|
} catch (err) {
|
||||||
|
// Error processing signature, output without further breakout
|
||||||
|
}
|
||||||
|
|
||||||
|
if (breakoutSig) { // DSA or ECDSA
|
||||||
sigStr = " r: " + PublicKey._formatByteStr(r.ASN1HEX.getDecendantHexVByNthList(certSig, 0, [0]), 16, 18) + "\n" +
|
sigStr = " r: " + PublicKey._formatByteStr(r.ASN1HEX.getDecendantHexVByNthList(certSig, 0, [0]), 16, 18) + "\n" +
|
||||||
" s: " + PublicKey._formatByteStr(r.ASN1HEX.getDecendantHexVByNthList(certSig, 0, [1]), 16, 18) + "\n";
|
" s: " + PublicKey._formatByteStr(r.ASN1HEX.getDecendantHexVByNthList(certSig, 0, [1]), 16, 18) + "\n";
|
||||||
} else { // RSA
|
} else { // RSA or unknown
|
||||||
sigStr = " Signature: " + PublicKey._formatByteStr(certSig, 16, 18) + "\n";
|
sigStr = " Signature: " + PublicKey._formatByteStr(certSig, 16, 18) + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue