diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-01-15 14:23:48 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-01-15 14:56:47 +0100 |
commit | b3704c5e6c4efdff0e87165c9e5da0d6a35ec20d (patch) | |
tree | daffcffff5ecb62f1e7e847a70a0766e46a42316 /src | |
parent | 57af3b052c7930910ec1d8defde7a42c29c855a8 (diff) | |
download | gnutls-b3704c5e6c4efdff0e87165c9e5da0d6a35ec20d.tar.gz |
gnutls_x509_crt_verify_hash: DEPRECATED
gnutls_x509_crt_verify_data: DEPRECATED
gnutls_x509_crt_get_verify_algorithm: DEPRECATED
gnutls_x509_crt_get_preferred_hash_algorithm: DEPRECATED
Removed the new gnutls_x509_privkey_sign_data2() and gnutls_x509_privkey_sign_hash2().
That functionality will be only in the abstract.h pubkey and privkey
structures, to avoid duplication for every certificate type.
Diffstat (limited to 'src')
-rw-r--r-- | src/certtool.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/certtool.c b/src/certtool.c index a470f42377..826b05c759 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -766,16 +766,28 @@ static gnutls_digest_algorithm_t get_dig (gnutls_x509_crt crt) { gnutls_digest_algorithm_t dig; + gnutls_pubkey_t pubkey; int result; unsigned int mand; - result = gnutls_x509_crt_get_preferred_hash_algorithm (crt, &dig, &mand); + gnutls_pubkey_init(&pubkey); + + result = gnutls_pubkey_import_x509(pubkey, crt, 0); + if (result < 0) + { + error (EXIT_FAILURE, 0, "gnutls_pubkey_import_x509: %s", + gnutls_strerror (result)); + } + + result = gnutls_pubkey_get_preferred_hash_algorithm (pubkey, &dig, &mand); if (result < 0) { - error (EXIT_FAILURE, 0, "crl_preferred_hash_algorithm: %s", + error (EXIT_FAILURE, 0, "crt_get_preferred_hash_algorithm: %s", gnutls_strerror (result)); } + gnutls_pubkey_deinit(pubkey); + /* if algorithm allows alternatives */ if (mand == 0 && default_dig != GNUTLS_DIG_UNKNOWN) dig = default_dig; |