Skip to content

Commit 3ed8290

Browse files
committed
LegacySSHStore: Include signatures etc.
1 parent e02edb1 commit 3ed8290

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/libstore/legacy-ssh-store.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ struct LegacySSHStore : public Store
105105
readLongLong(conn->from); // download size
106106
info->narSize = readLongLong(conn->from);
107107

108+
if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 4) {
109+
auto s = readString(conn->from);
110+
info->narHash = s.empty() ? Hash() : Hash(s);
111+
conn->from >> info->ca;
112+
info->sigs = readStrings<StringSet>(conn->from);
113+
}
114+
108115
auto s = readString(conn->from);
109116
assert(s == "");
110117

src/libstore/serve-protocol.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace nix {
55
#define SERVE_MAGIC_1 0x390c9deb
66
#define SERVE_MAGIC_2 0x5452eecb
77

8-
#define SERVE_PROTOCOL_VERSION 0x203
8+
#define SERVE_PROTOCOL_VERSION 0x204
99
#define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00)
1010
#define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)
1111

src/nix-store/nix-store.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,8 @@ static void opServe(Strings opFlags, Strings opArgs)
858858
// !!! Maybe we want compression?
859859
out << info->narSize // downloadSize
860860
<< info->narSize;
861+
if (GET_PROTOCOL_MINOR(clientVersion) >= 4)
862+
out << (info->narHash ? info->narHash.to_string() : "") << info->ca << info->sigs;
861863
} catch (InvalidPath &) {
862864
}
863865
}

0 commit comments

Comments
 (0)