Browse Source

Justus mem patches to sequoia driver

master Release_3.1.3
Krista Bennett 3 months ago
parent
commit
a630672a51
1 changed files with 16 additions and 9 deletions
  1. +16
    -9
      src/pgp_sequoia.c

+ 16
- 9
src/pgp_sequoia.c View File

@ -1508,7 +1508,7 @@ decrypt_cb(void *cookie_opaque,
for (size_t i = 0; i < pkesk_count; i ++) {
pgp_pkesk_t pkesk = pkesks[i];
pgp_keyid_t keyid = pgp_pkesk_recipient(pkesk); /* Reference. */
pgp_keyid_t keyid = pgp_pkesk_recipient(pkesk);
char *keyid_str = pgp_keyid_to_hex(keyid);
pgp_cert_key_iter_t key_iter = NULL;
pgp_key_amalgamation_t ka = NULL;
@ -1610,6 +1610,7 @@ decrypt_cb(void *cookie_opaque,
cookie->decrypted = 1;
eol:
pgp_keyid_free (keyid);
pgp_session_key_free (sk);
free(keyid_str);
pgp_key_free (key);
@ -1621,7 +1622,7 @@ decrypt_cb(void *cookie_opaque,
// Consider wildcard recipients.
if (wildcards) for (size_t i = 0; i < pkesk_count && !cookie->decrypted; i ++) {
pgp_pkesk_t pkesk = pkesks[i];
pgp_keyid_t keyid = pgp_pkesk_recipient(pkesk); /* Reference. */
pgp_keyid_t keyid = pgp_pkesk_recipient(pkesk);
char *keyid_str = pgp_keyid_to_hex(keyid);
pgp_cert_key_iter_t key_iter = NULL;
pgp_key_amalgamation_t ka = NULL;
@ -1712,6 +1713,7 @@ decrypt_cb(void *cookie_opaque,
key_iter = NULL;
}
eol2:
pgp_keyid_free (keyid);
pgp_session_key_free (sk);
free(keyid_str);
pgp_key_free (key);
@ -2067,10 +2069,13 @@ PEP_STATUS pgp_decrypt_and_verify(
stringlist_add(cookie.signer_keylist, "");
*keylist = cookie.signer_keylist;
cookie.signer_keylist = NULL; /* Moved. */
stringlist_append(*keylist, cookie.recipient_keylist);
if (filename_ptr)
if (filename_ptr) {
*filename_ptr = cookie.filename;
cookie.filename = NULL; /* Moved. */
}
out:
if (status == PEP_STATUS_OK) {
@ -2101,12 +2106,13 @@ PEP_STATUS pgp_decrypt_and_verify(
status = PEP_DECRYPTED;
}
} else {
free_stringlist(cookie.recipient_keylist);
free_stringlist(cookie.signer_keylist);
free(cookie.filename);
free(*ptext);
*ptext = NULL;
}
free_stringlist(cookie.recipient_keylist);
free_stringlist(cookie.signer_keylist);
free(cookie.filename);
pgp_reader_free(reader);
pgp_reader_free(decryptor);
pgp_writer_free(writer);
@ -2214,6 +2220,7 @@ PEP_STATUS pgp_verify_text(
stringlist_add(cookie.signer_keylist, "");
*keylist = cookie.signer_keylist;
cookie.signer_keylist = NULL; /* Moved. */
stringlist_append(*keylist, cookie.recipient_keylist);
out:
@ -2244,11 +2251,11 @@ PEP_STATUS pgp_verify_text(
// don't have the keys).
status = PEP_UNENCRYPTED;
}
} else {
free_stringlist(cookie.recipient_keylist);
free_stringlist(cookie.signer_keylist);
}
free_stringlist(cookie.recipient_keylist);
free_stringlist(cookie.signer_keylist);
pgp_reader_free(reader);
pgp_reader_free(dsig_reader);


Loading…
Cancel
Save