From 3ae2a848aeea53aedf625bdb540ad9a5a4a42551 Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Thu, 11 Jul 2019 22:06:59 +0000 Subject: [PATCH] libsecureboot: avoid recusion in ve_trust_init set our guard value immediately. also replace call to ve_trust_init in opgp_sig.c:initialize with call to openpgp_trust_init. Reported by: mindal@semihalf.com Reviewed by: jhibbits obrien MFC after: 1 week --- lib/libsecureboot/openpgp/opgp_sig.c | 4 +--- lib/libsecureboot/vets.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libsecureboot/openpgp/opgp_sig.c b/lib/libsecureboot/openpgp/opgp_sig.c index df4c33e6405d..c16d8974e8a3 100644 --- a/lib/libsecureboot/openpgp/opgp_sig.c +++ b/lib/libsecureboot/openpgp/opgp_sig.c @@ -67,9 +67,7 @@ __FBSDID("$FreeBSD$"); void initialize (void) { -#ifdef _STANDALONE - ve_trust_init(); -#endif + openpgp_trust_init(); } #else diff --git a/lib/libsecureboot/vets.c b/lib/libsecureboot/vets.c index 87fb190577eb..bc654f1129e0 100644 --- a/lib/libsecureboot/vets.c +++ b/lib/libsecureboot/vets.c @@ -345,7 +345,7 @@ ve_trust_init(void) if (once >= 0) return (once); - + once = 0; /* to be sure */ ve_utc_set(time(NULL)); #ifdef BUILD_UTC ve_utc_set(BUILD_UTC); /* just in case */