mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
sm: Support decryption of password based encryption (pwri)
* sm/decrypt.c (string_from_gcry_buffer): New.
(pwri_parse_pbkdf2): New.
(pwri_decrypt): New.
(prepare_decryption): Support pwri.
(gpgsm_decrypt): Test for PWRI. Move IS_DE_VS flag to DFPARM.
* common/sexputil.c (cipher_mode_to_string): New.
--
Note that this is not finished because we need to implement a password
callback. For now "abc" is used as passwort.
Latest libksba is also required to return the required info.
Signed-off-by: Werner Koch <wk@gnupg.org>
Backported-from-master: 02029f9eab
Note that this change also prints the used algorithm and shows some
existsing diagnostics only in verbose mode.
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
b6f8cd7eef
commit
6f31acac76
3 changed files with 493 additions and 57 deletions
|
@ -1170,3 +1170,19 @@ hash_algo_to_string (int algo)
|
|||
return hashnames[i].name;
|
||||
return "?";
|
||||
}
|
||||
|
||||
|
||||
/* Map cipher modes to a string. */
|
||||
const char *
|
||||
cipher_mode_to_string (int mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case GCRY_CIPHER_MODE_CFB: return "CFB";
|
||||
case GCRY_CIPHER_MODE_CBC: return "CBC";
|
||||
case GCRY_CIPHER_MODE_GCM: return "GCM";
|
||||
case GCRY_CIPHER_MODE_OCB: return "OCB";
|
||||
case 14: return "EAX"; /* Only in gcrypt 1.9 */
|
||||
default: return "[?]";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,6 +216,7 @@ int get_pk_algo_from_canon_sexp (const unsigned char *keydata,
|
|||
char *pubkey_algo_string (gcry_sexp_t s_pkey, enum gcry_pk_algos *r_algoid);
|
||||
const char *pubkey_algo_to_string (int algo);
|
||||
const char *hash_algo_to_string (int algo);
|
||||
const char *cipher_mode_to_string (int mode);
|
||||
|
||||
/*-- convert.c --*/
|
||||
int hex2bin (const char *string, void *buffer, size_t length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue