summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg/config.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-09-15 05:46:55 +0000
committerbapt <bapt@FreeBSD.org>2015-09-15 05:46:55 +0000
commit07bd68bf9d301675658c8c99a44ac63d403d0608 (patch)
tree1548e6252547c77f8d6712b847c9b29eca6742d7 /usr.sbin/pkg/config.c
parentc6c0cd45579f43f207e8e2947ad33106d634728a (diff)
downloadFreeBSD-src-07bd68bf9d301675658c8c99a44ac63d403d0608.zip
FreeBSD-src-07bd68bf9d301675658c8c99a44ac63d403d0608.tar.gz
MFC: r287579
Implement pubkey support for the bootstrap Note that to not interfer with finger print it expects a signature on pkg itself which is named pkg.txz.pubkeysign To genrate it: echo -n "$(sha256 -q pkg.txz)" | openssl dgst -sha256 -sign /thekey \ -binary -out ./pkg.txz.pubkeysig Note the "echo -n" which prevent signing the '\n' one would get otherwise PR: 202622
Diffstat (limited to 'usr.sbin/pkg/config.c')
-rw-r--r--usr.sbin/pkg/config.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c
index 3a1f18d..b0271f5 100644
--- a/usr.sbin/pkg/config.c
+++ b/usr.sbin/pkg/config.c
@@ -131,6 +131,15 @@ static struct config_entry c[] = {
false,
true,
},
+ [PUBKEY] = {
+ PKG_CONFIG_STRING,
+ "PUBKEY",
+ NULL,
+ NULL,
+ NULL,
+ false,
+ false
+ }
};
static int
@@ -231,6 +240,8 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype)
sbuf_cpy(buf, "SIGNATURE_TYPE");
else if (strcasecmp(key, "fingerprints") == 0)
sbuf_cpy(buf, "FINGERPRINTS");
+ else if (strcasecmp(key, "pubkey") == 0)
+ sbuf_cpy(buf, "PUBKEY");
else if (strcasecmp(key, "enabled") == 0) {
if ((cur->type != UCL_BOOLEAN) ||
!ucl_object_toboolean(cur))
OpenPOWER on IntegriCloud