| ... | @@ -2199,10 +2199,15 @@ pub const Signature = union(enum) { | ... | @@ -2199,10 +2199,15 @@ pub const Signature = union(enum) { |
| 2199 | const sigversion = try b64r.readInt(u32, .big); | 2199 | const sigversion = try b64r.readInt(u32, .big); |
| 2200 | if (sigversion != 1) return .unrecognized; | 2200 | if (sigversion != 1) return .unrecognized; |
| 2201 | const publickey = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); | 2201 | const publickey = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); |
| | 2202 | errdefer allocator.free(publickey); |
| 2202 | const namespace = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); | 2203 | const namespace = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); |
| | 2204 | defer allocator.free(namespace); |
| 2203 | const reserved = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); | 2205 | const reserved = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); |
| | 2206 | defer allocator.free(reserved); |
| 2204 | const hash_algorithm = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); | 2207 | const hash_algorithm = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); |
| | 2208 | errdefer allocator.free(hash_algorithm); |
| 2205 | const signature = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); | 2209 | const signature = try b64r.readAlloc(allocator, try b64r.readInt(u32, .big)); |
| | 2210 | errdefer allocator.free(signature); |
| 2206 | if (!std.mem.eql(u8, namespace, "git")) return .unrecognized; | 2211 | if (!std.mem.eql(u8, namespace, "git")) return .unrecognized; |
| 2207 | if (reserved.len > 0) return .unrecognized; | 2212 | if (reserved.len > 0) return .unrecognized; |
| 2208 | | 2213 | |