1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Remove OpenSSL-based signing

This commit is contained in:
Eelco Dolstra 2016-05-03 15:11:14 +02:00
parent dfebfc835f
commit f435f82475
16 changed files with 52 additions and 142 deletions

View file

@ -14,7 +14,6 @@ $storeDir = $ENV{"NIX_STORE_DIR"} || "@storedir@";
$bzip2 = "@bzip2@";
$xz = "@xz@";
$curl = "@curl@";
$openssl = "@openssl@";
$useBindings = "@perlbindings@" eq "yes";

View file

@ -10,7 +10,7 @@ use IPC::Open2;
sub copyToOpen {
my ($from, $to, $sshHost, $storePaths, $includeOutputs, $dryRun, $sign, $useSubstitutes) = @_;
my ($from, $to, $sshHost, $storePaths, $includeOutputs, $dryRun, $useSubstitutes) = @_;
$useSubstitutes = 0 if $dryRun || !defined $useSubstitutes;
@ -41,13 +41,13 @@ sub copyToOpen {
# Send the "import paths" command.
syswrite($to, pack("L<x4", 4)) or die;
exportPaths(fileno($to), $sign, @missing);
exportPaths(fileno($to), @missing);
readInt($from) == 1 or die "remote machine $sshHost failed to import closure\n";
}
sub copyTo {
my ($sshHost, $storePaths, $includeOutputs, $dryRun, $sign, $useSubstitutes) = @_;
my ($sshHost, $storePaths, $includeOutputs, $dryRun, $useSubstitutes) = @_;
# Connect to the remote host.
my ($from, $to);
@ -61,7 +61,7 @@ sub copyTo {
return oldCopyTo(@_);
}
copyToOpen($from, $to, $sshHost, $storePaths, $includeOutputs, $dryRun, $sign, $useSubstitutes);
copyToOpen($from, $to, $sshHost, $storePaths, $includeOutputs, $dryRun, $useSubstitutes);
close $to;
}
@ -70,7 +70,7 @@ sub copyTo {
# For backwards compatibility with Nix <= 1.7. Will be removed
# eventually.
sub oldCopyTo {
my ($sshHost, $storePaths, $includeOutputs, $dryRun, $sign, $useSubstitutes) = @_;
my ($sshHost, $storePaths, $includeOutputs, $dryRun, $useSubstitutes) = @_;
# Get the closure of this path.
my @closure = reverse(topoSortPaths(computeFSClosure(0, $includeOutputs,
@ -105,7 +105,7 @@ sub oldCopyTo {
print STDERR "copying ", scalar @missing, " missing paths to $sshHost...\n";
unless ($dryRun) {
open SSH, "| ssh $sshHost @globalSshOpts 'nix-store --import' > /dev/null" or die;
exportPaths(fileno(SSH), $sign, @missing);
exportPaths(fileno(SSH), @missing);
close SSH or die "copying store paths to remote machine $sshHost failed: $?";
}
}

View file

@ -169,13 +169,13 @@ SV * followLinksToStorePath(char * path)
RETVAL
void exportPaths(int fd, int sign, ...)
void exportPaths(int fd, ...)
PPCODE:
try {
Paths paths;
for (int n = 2; n < items; ++n) paths.push_back(SvPV_nolen(ST(n)));
FdSink sink(fd);
store()->exportPaths(paths, sign, sink);
store()->exportPaths(paths, sink);
} catch (Error & e) {
croak("%s", e.what());
}
@ -185,7 +185,7 @@ void importPaths(int fd)
PPCODE:
try {
FdSource source(fd);
store()->importPaths(false, source, 0);
store()->importPaths(source, 0);
} catch (Error & e) {
croak("%s", e.what());
}