| ... | ... | @@ -2575,6 +2575,19 @@ pub const Signature = union(enum) { |
| 2575 | 2575 | const sig = sigfixed.readSlice(sig_len) catch break :blk; |
| 2576 | 2576 | valid = if (pgp_rsa_verify(pk_n.len, sig, signed_data.items, pk, .sha2_256)) true else |err| if (err == error.unrecognized) null else false; |
| 2577 | 2577 | } |
| 2578 | if (std.mem.eql(u8, sigformat, "rsa-sha2-512")) blk: { |
| 2579 | const ns = std.crypto.Certificate.rsa; |
| 2580 | const pk_e_len = pkfixed.readInt(u32, .big) catch break :blk; |
| 2581 | var pk_e = pkfixed.readSlice(pk_e_len) catch break :blk; |
| 2582 | if (pk_e[0] == 0) pk_e = pk_e[1..]; |
| 2583 | const pk_n_len = pkfixed.readInt(u32, .big) catch break :blk; |
| 2584 | var pk_n = pkfixed.readSlice(pk_n_len) catch break :blk; |
| 2585 | if (pk_n[0] == 0) pk_n = pk_n[1..]; |
| 2586 | const pk = ns.PublicKey.fromBytes(pk_e, pk_n) catch break :blk; |
| 2587 | const sig_len = sigfixed.readInt(u32, .big) catch break :blk; |
| 2588 | const sig = sigfixed.readSlice(sig_len) catch break :blk; |
| 2589 | valid = if (pgp_rsa_verify(pk_n.len, sig, signed_data.items, pk, .sha2_512)) true else |err| if (err == error.unrecognized) null else false; |
| 2590 | } |
| 2578 | 2591 | if (std.mem.eql(u8, sigformat, "ssh-ed25519")) blk: { |
| 2579 | 2592 | const ed = std.crypto.sign.Ed25519; |
| 2580 | 2593 | const pk_len = pkfixed.readInt(u32, .big) catch break :blk; |
| ... | ... | @@ -2636,7 +2649,6 @@ pub const Signature = union(enum) { |
| 2636 | 2649 | // ssh-dss (dsa) |
| 2637 | 2650 | // sk-ecdsa-sha2-nistp256@openssh.com |
| 2638 | 2651 | // sk-ssh-ed25519@openssh.com |
| 2639 | | // rsa-sha2-512 |
| 2640 | 2652 | |
| 2641 | 2653 | return .{ .ssh = .{ |
| 2642 | 2654 | .publickey = publickey, |