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:
parent
a64da5915d
commit
94378910fb
3 changed files with 17 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue