Skip to content

Instantly share code, notes, and snippets.

@williamcroberts
Created January 4, 2023 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save williamcroberts/80f37b1772b61a975214cc5c03cbf06a to your computer and use it in GitHub Desktop.
Save williamcroberts/80f37b1772b61a975214cc5c03cbf06a to your computer and use it in GitHub Desktop.
systemd patch
wcrobert@wcrobert-mobl1:~/workspace/systemd$ git diff
diff --git a/src/cryptenroll/cryptenroll-tpm2.c b/src/cryptenroll/cryptenroll-tpm2.c
index bd60b79e42a7..cce04e6c4496 100644
--- a/src/cryptenroll/cryptenroll-tpm2.c
+++ b/src/cryptenroll/cryptenroll-tpm2.c
@@ -174,6 +174,7 @@ int enroll_tpm2(struct crypt_device *cd,
/* re-stringify pin_str */
// Question: r is in int but base64mem returns ssize_t, this was copied
// from enroll_fido2 from line 56.
+ erase_and_freep(pin_str);
r = base64mem(salted_pin, sizeof(salted_pin), &pin_str);
if (r < 0)
return log_error_errno(r, "Failed to base64 encode salted pin: %m");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment