mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 22:33:48 -07:00
signature decode r and s works
This commit is contained in:
parent
38004f9db5
commit
5b9c51fb7e
1 changed files with 6 additions and 9 deletions
|
@ -244,15 +244,12 @@ static int ndefDecodeSig2(uint8_t *sig, size_t siglen) {
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(NORMAL, "\tsignature [%zu]: %s", intsiglen, sprint_hex_inrow(&sig[indx], intsiglen));
|
PrintAndLogEx(NORMAL, "\tsignature [%zu]: %s", intsiglen, sprint_hex_inrow(&sig[indx], intsiglen));
|
||||||
if (sigType == stECDSA_P192 || sigType == stECDSA_P256) {
|
if (sigType == stECDSA_P192 || sigType == stECDSA_P256) {
|
||||||
PrintAndLogEx(NORMAL, "\tsignature: ECDSA");
|
int slen = intsiglen / 2;
|
||||||
uint8_t rval[300] = {0};
|
if (slen == 24 || slen == 32) {
|
||||||
uint8_t sval[300] = {0};
|
PrintAndLogEx(NORMAL, "\tsignature: ECDSA-%d", slen * 8);
|
||||||
int res = ecdsa_asn1_get_signature(&sig[indx], intsiglen, rval, sval);
|
PrintAndLogEx(NORMAL, "\t\tr: %s", sprint_hex(&sig[indx], slen));
|
||||||
if (!res) {
|
indx += slen;
|
||||||
PrintAndLogEx(NORMAL, "\t\tr: %s", sprint_hex(rval, 32));
|
PrintAndLogEx(NORMAL, "\t\ts: %s", sprint_hex(&sig[indx], slen));
|
||||||
PrintAndLogEx(NORMAL, "\t\ts: %s", sprint_hex(sval, 32));
|
|
||||||
} else {
|
|
||||||
PrintAndLogEx(NORMAL, "\t\error signature decode");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(NORMAL, "\tsignature: unknown type");
|
PrintAndLogEx(NORMAL, "\tsignature: unknown type");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue