Skip to content

Instantly share code, notes, and snippets.

@lazka

lazka/a.diff Secret

Created February 12, 2023 10:35
Show Gist options
  • Save lazka/542641bc69b36630dc6d652699c8773a to your computer and use it in GitHub Desktop.
Save lazka/542641bc69b36630dc6d652699c8773a to your computer and use it in GitHub Desktop.
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index a7be3a1a..f6f0ebda 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -614,6 +614,9 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
gpg_err = gpgme_data_new_from_stream(&filedata, file);
CHECK_ERR();
+ gpg_err = gpgme_data_set_flag(filedata, "io-buffer-size", "1048576");
+ CHECK_ERR();
+
/* next create data object for the signature */
if(base64_sig) {
/* memory-based, we loaded it from a sync DB */
@@ -631,6 +634,9 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
}
CHECK_ERR();
+ gpg_err = gpgme_data_set_flag(sigdata, "io-buffer-size", "1048576");
+ CHECK_ERR();
+
/* here's where the magic happens */
gpg_err = gpgme_op_verify(ctx, sigdata, filedata, NULL);
CHECK_ERR();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment