Skip to content

Commit

Permalink
Update signing utility
Browse files Browse the repository at this point in the history
  • Loading branch information
mafik committed Jun 5, 2024
1 parent 8f7efe9 commit 87aee14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ssh_key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ SSHKey SSHKey::FromFile(const Path &path, Status &status) {
}
buf = buf.subspan(kSshKeyMagic.size());
auto ConsumeSizedSpan = [&](Span<> &buf_arg) -> Span<> {
U32 len = ConsumeBigEndian<U32>(buf_arg);
U32 len = buf_arg.Consume<Big<U32>>();
Span<> ret = buf_arg.subspan(0, len);
buf_arg.RemovePrefix(len);
return ret;
};
StrView cipher_name = StrViewOf(ConsumeSizedSpan(buf));
StrView kdf_name = StrViewOf(ConsumeSizedSpan(buf));
Span<> kdf = ConsumeSizedSpan(buf);
U32 num_keys = ConsumeBigEndian<U32>(buf);
U32 num_keys = buf.Consume<Big<U32>>();
if (num_keys != 1) {
AppendErrorMessage(status) += "Key at " + Str(path) +
" should have exactly one key, got " +
Expand All @@ -77,8 +77,8 @@ SSHKey SSHKey::FromFile(const Path &path, Status &status) {
Span<> priv = ConsumeSizedSpan(buf);

// Parse `priv`
U32 check1 = ConsumeBigEndian<U32>(priv);
U32 check2 = ConsumeBigEndian<U32>(priv);
U32 check1 = priv.Consume<Big<U32>>();
U32 check2 = priv.Consume<Big<U32>>();
StrView key_type = StrViewOf(ConsumeSizedSpan(priv));
if (key_type == "ssh-ed25519"sv) {
Span<> pub0 = ConsumeSizedSpan(priv);
Expand Down

0 comments on commit 87aee14

Please sign in to comment.