]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - certs/extract-cert.c
Merge tag 'kbuild-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[thirdparty/linux.git] / certs / extract-cert.c
index 8c1fb9a70d66b8758cd8b3b89a4872debe588488..70e9ec89d87d3606d25ded861c47d78ab1579cf6 100644 (file)
@@ -78,7 +78,7 @@ static void drain_openssl_errors(void)
 static const char *key_pass;
 static BIO *wb;
 static char *cert_dst;
-static int kbuild_verbose;
+static bool verbose;
 
 static void write_cert(X509 *x509)
 {
@@ -90,19 +90,22 @@ static void write_cert(X509 *x509)
        }
        X509_NAME_oneline(X509_get_subject_name(x509), buf, sizeof(buf));
        ERR(!i2d_X509_bio(wb, x509), "%s", cert_dst);
-       if (kbuild_verbose)
+       if (verbose)
                fprintf(stderr, "Extracted cert: %s\n", buf);
 }
 
 int main(int argc, char **argv)
 {
        char *cert_src;
+       char *verbose_env;
 
        OpenSSL_add_all_algorithms();
        ERR_load_crypto_strings();
        ERR_clear_error();
 
-       kbuild_verbose = atoi(getenv("KBUILD_VERBOSE")?:"0");
+       verbose_env = getenv("KBUILD_VERBOSE");
+       if (verbose_env && strchr(verbose_env, '1'))
+               verbose = true;
 
         key_pass = getenv("KBUILD_SIGN_PIN");