]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
measure: rename measure_pcr() to measure_kernel()
authorLennart Poettering <lennart@poettering.net>
Sat, 17 Sep 2022 13:20:32 +0000 (15:20 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 17 Sep 2022 22:27:00 +0000 (07:27 +0900)
Let's say what we actually measure, not what into (which is obvious
anyway).

This is generally more descriptive, but also good for later work that
allows measuring the boot phase too.

src/boot/measure.c

index bc8f720514bed15d5d21c2e328245a48d09a388a..983d407e39b056dcfb1cd7ef27f06c22ddfbdabf 100644 (file)
@@ -311,7 +311,7 @@ static int pcr_state_extend(PcrState *pcr_state, const void *data, size_t sz) {
 
 #define BUFFER_SIZE (16U * 1024U)
 
-static int measure_pcr(PcrState *pcr_states, size_t n) {
+static int measure_kernel(PcrState *pcr_states, size_t n) {
         _cleanup_free_ void *buffer = NULL;
         int r;
 
@@ -415,7 +415,7 @@ static int measure_pcr(PcrState *pcr_states, size_t n) {
                         if (r < 0)
                                 return r;
 
-                        /* Retrieve hash of data an measure it*/
+                        /* Retrieve hash of data and measure it */
                         if (EVP_DigestFinal_ex(mdctx[i], data_hash, &data_hash_size) != 1)
                                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to finalize hash context.");
 
@@ -486,7 +486,7 @@ static int verb_calculate(int argc, char *argv[], void *userdata) {
 
         n = (size_t) r;
 
-        r = measure_pcr(pcr_states, n);
+        r = measure_kernel(pcr_states, n);
         if (r < 0)
                 return r;
 
@@ -591,7 +591,7 @@ static int verb_sign(int argc, char *argv[], void *userdata) {
 
         n = (size_t) r;
 
-        r = measure_pcr(pcr_states, n);
+        r = measure_kernel(pcr_states, n);
         if (r < 0)
                 return r;