mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
fix #9: enable verifying own signature
This commit is contained in:
15
libpcp/ed.c
15
libpcp/ed.c
@@ -403,6 +403,21 @@ pcp_pubkey_t *pcp_ed_detachverify_buffered(PCPCTX *ptx, Pcpstream *in, Pcpstream
|
|||||||
if(verifiedhash != NULL)
|
if(verifiedhash != NULL)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* no pubkey found yet, try our own */
|
||||||
|
pcp_key_t *k;
|
||||||
|
pcp_pubkey_t *pub;
|
||||||
|
pcphash_iterate(ptx, k) {
|
||||||
|
if(k->type == PCP_KEY_TYPE_MAINSECRET) {
|
||||||
|
pub = pcpkey_pub_from_secret(k);
|
||||||
|
verifiedhash = pcp_ed_verify(ptx, sighash, mlen, pub);
|
||||||
|
if(verifiedhash != NULL) {
|
||||||
|
/* good, self-signed */
|
||||||
|
p = pub;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
verifiedhash = pcp_ed_verify(ptx, sighash, mlen, p);
|
verifiedhash = pcp_ed_verify(ptx, sighash, mlen, p);
|
||||||
|
|||||||
Reference in New Issue
Block a user