summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Goldberg <rgoldber@redhat.com>2023-08-31 09:39:39 -0400
committerRyan Goldberg <rgoldber@redhat.com>2023-08-31 09:39:39 -0400
commitcc0169b4dba7a09349823683ac7be18583fbc30e (patch)
tree8d4ccf34b5e12a5c516c04a06fe0cb69bf6b50b7
parent4e2244327d13c2a0d72de46df0694ad78407149a (diff)
debuginfod: PR28204 - Minor bug fixesupstream/users/rgoldber/try-bz28204d
-rw-r--r--configure.ac2
-rw-r--r--debuginfod/debuginfod-client.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 3f55ca29..840a0ab0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -688,7 +688,7 @@ AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [
debuginfod_ima_verification_enabled="no"
if test "$enable_ima_verification" = "xrpmimaevmcrypto"; then
debuginfod_ima_verification_enabled="yes"
- default_ima_cert_path=`eval echo "/etc/pki/rpm-ima:$sysconfdir/debuginfod/ima-certs"` # expand $prefix too
+ default_ima_cert_path=`eval echo "/etc/keys/ima:$sysconfdir/debuginfod/ima-certs"` # expand $prefix too
AC_DEFINE([ENABLE_IMA_VERIFICATION], [1], [Define if the required ima verification libraries are available])
AC_DEFINE_UNQUOTED(DEBUGINFOD_IMA_CERT_PATH_DEFAULT, "$default_ima_cert_path", [Default IMA certificate path])
fi
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index decb444d..c28d7c3f 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -972,7 +972,7 @@ debuginfod_validate_imasig (debuginfod_client *c, const char* tmp_path, int fd)
char file_data[DATA_SIZE];
ssize_t n;
- for(long k = 0; k < data_len; k += DATA_SIZE)
+ for(long k = 0; k < data_len; k += n)
{
if (-1 == (n = pread(fd, file_data, DATA_SIZE, k)))
{
@@ -1001,7 +1001,7 @@ debuginfod_validate_imasig (debuginfod_client *c, const char* tmp_path, int fd)
uint32_t keyid = ntohl(((struct signature_v2_hdr *)(bin_sig + 1))->keyid); // The signature's keyid
imaevm_params.verbose = 0;
- cert_paths = strdup (getenv(DEBUGINFOD_IMA_CERT_PATH_ENV_VAR) ?: DEBUGINFOD_IMA_CERT_PATH_DEFAULT);
+ cert_paths = strdup (getenv(DEBUGINFOD_IMA_CERT_PATH_ENV_VAR) ?: strdup(DEBUGINFOD_IMA_CERT_PATH_DEFAULT));
rc = ENOKEY; // This is updated iff a good cert is found
if (!cert_paths)
goto exit_validate;