diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-12 18:42:55 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-12 18:42:55 +0200 |
commit | 4f0d888361475d75d82e68d9351d809cb7f739c5 (patch) | |
tree | d49783a8a7579918788c3241048454ed8d3431e9 /lib/openpgp | |
parent | 49575ac3dce9c07c5ad6d759adee1eb93253dadd (diff) | |
download | gnutls-4f0d888361475d75d82e68d9351d809cb7f739c5.tar.gz |
Added debugging.
Diffstat (limited to 'lib/openpgp')
-rw-r--r-- | lib/openpgp/privkey.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/openpgp/privkey.c b/lib/openpgp/privkey.c index 77ef7b403a..93fd683981 100644 --- a/lib/openpgp/privkey.c +++ b/lib/openpgp/privkey.c @@ -1336,6 +1336,7 @@ gnutls_openpgp_privkey_sign_hash (gnutls_openpgp_privkey_t key, gnutls_pk_params_st params; int pk_algorithm; uint8_t keyid[GNUTLS_OPENPGP_KEYID_SIZE]; + char buf[2*GNUTLS_OPENPGP_KEYID_SIZE+1]; if (key == NULL) { @@ -1350,6 +1351,8 @@ gnutls_openpgp_privkey_sign_hash (gnutls_openpgp_privkey_t key, int idx; KEYID_IMPORT (kid, keyid); + + _gnutls_hard_log("Signing using PGP key ID %s\n", _gnutls_bin2hex(keyid, GNUTLS_OPENPGP_KEYID_SIZE, buf, sizeof(buf), NULL)); idx = gnutls_openpgp_privkey_get_subkey_idx (key, keyid); pk_algorithm = @@ -1359,6 +1362,8 @@ gnutls_openpgp_privkey_sign_hash (gnutls_openpgp_privkey_t key, } else { + _gnutls_hard_log("Signing using master PGP key\n"); + pk_algorithm = gnutls_openpgp_privkey_get_pk_algorithm (key, NULL); result = _gnutls_openpgp_privkey_get_mpis (key, NULL, ¶ms); } @@ -1408,6 +1413,7 @@ _gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key, gnutls_pk_params_st params; int pk_algorithm; uint8_t keyid[GNUTLS_OPENPGP_KEYID_SIZE]; + char buf[2*GNUTLS_OPENPGP_KEYID_SIZE+1]; if (key == NULL) { @@ -1421,6 +1427,9 @@ _gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key, uint32_t kid[2]; KEYID_IMPORT (kid, keyid); + + _gnutls_hard_log("Decrypting using PGP key ID %s\n", _gnutls_bin2hex(keyid, GNUTLS_OPENPGP_KEYID_SIZE, buf, sizeof(buf), NULL)); + result = _gnutls_openpgp_privkey_get_mpis (key, kid, ¶ms); i = gnutls_openpgp_privkey_get_subkey_idx (key, keyid); @@ -1429,6 +1438,8 @@ _gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key, } else { + _gnutls_hard_log("Decrypting using master PGP key\n"); + pk_algorithm = gnutls_openpgp_privkey_get_pk_algorithm (key, NULL); result = _gnutls_openpgp_privkey_get_mpis (key, NULL, ¶ms); |