mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Add arg session_algo to pk_decrypt.
* common/kem.c: Move constants to the top. Add some documentation. * g10/pkglue.c (pk_encrypt): Add arguments session_key and factor code out to ... (do_encrypt_rsa_elg): here, (do_encrypt_ecdh): and here, (do_encrypt_kem): and here. * g10/encrypt.c (write_pubkey_enc): Call with session key algorithm. -- This makes it easier to review the code.
This commit is contained in:
parent
35ef87d8d9
commit
4c20d2d273
4 changed files with 188 additions and 134 deletions
|
@ -1138,7 +1138,7 @@ write_pubkey_enc (ctrl_t ctrl,
|
|||
* build_packet(). */
|
||||
frame = encode_session_key (pk->pubkey_algo, dek,
|
||||
pubkey_nbits (pk->pubkey_algo, pk->pkey));
|
||||
rc = pk_encrypt (pk, frame, enc->data);
|
||||
rc = pk_encrypt (pk, frame, dek->algo, enc->data);
|
||||
gcry_mpi_release (frame);
|
||||
if (rc)
|
||||
log_error ("pubkey_encrypt failed: %s\n", gpg_strerror (rc) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue