1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Handle base-16 NarHash fields in signed .narinfo files

This commit is contained in:
Eelco Dolstra 2015-06-03 15:33:17 +02:00
parent a64da5915d
commit 94378910fb
3 changed files with 17 additions and 3 deletions

View file

@ -232,6 +232,17 @@ SV * hashString(char * algo, int base32, char * s)
}
SV * convertHash(char * algo, char * s, int toBase32)
PPCODE:
try {
Hash h = parseHash16or32(parseHashType(algo), s);
string s = toBase32 ? printHash32(h) : printHash(h);
XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
} catch (Error & e) {
croak(e.what());
}
SV * signString(SV * secretKey_, char * msg)
PPCODE:
try {