Skip to content

Commit ae16275

Browse files
committed
move minisign pubkey to build option
1 parent 48fcf2b commit ae16275

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

build.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const std = @import("std");
22
// const zon: struct { version: []const u8 } = @import("./build.zig.zon");
33

44
const name = "zigbar";
5-
const version = std.SemanticVersion.parse("0.3.0") catch unreachable;
5+
const version = std.SemanticVersion.parse("0.4.0") catch unreachable;
66

77
const targets: []const std.Target.Query = &.{
88
.{ .cpu_arch = .aarch64, .os_tag = .macos },
@@ -32,6 +32,7 @@ pub fn build(b: *std.Build) !void {
3232
options.addOption([]const u8, "name", name);
3333
options.addOption([]const u8, "triple", triple);
3434
options.addOption(std.SemanticVersion, "version", version);
35+
options.addOption([]const u8, "minisign_public_key", "RWRdnhTwGE7SUzRJwb+f48phQN3hyxCfOXXpOBBFq9L1BwFU51JlXly2");
3536
mod.addOptions("config", options);
3637
mod.addImport("minizign", minizign.module("minizign"));
3738

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = .zigbar,
3-
.version = "0.3.0",
3+
.version = "0.4.0",
44
.fingerprint = 0xa016003a8035f03b,
55
.minimum_zig_version = "0.14.0",
66
.paths = .{

src/update.zig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ pub const UpdateError = error{
1414
SigError,
1515
};
1616

17-
const minisign_public_key = "RWRdnhTwGE7SUzRJwb+f48phQN3hyxCfOXXpOBBFq9L1BwFU51JlXly2";
18-
1917
pub const build_name: []const u8 = config.name;
2018
pub const build_triple: []const u8 = config.triple;
2119
pub const build_version: Version = config.version;
@@ -138,7 +136,7 @@ fn validateSignature(allocator: Allocator) !void {
138136
try fs.accessAbsolute(sig_path, .{ .mode = .read_only });
139137
const file = try fs.openFileAbsolute(tar_path, .{ .mode = .read_only });
140138
defer file.close();
141-
const pubkey = try minizign.PublicKey.decodeFromBase64(minisign_public_key);
139+
const pubkey = try minizign.PublicKey.decodeFromBase64(config.minisign_public_key);
142140
var signature = try minizign.Signature.fromFile(allocator, sig_path);
143141
defer signature.deinit();
144142
try pubkey.verifyFile(allocator, file, signature, false);

0 commit comments

Comments
 (0)