]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Remove gnutls_x509_crq_get_preferred_hash_algorithm.
authorSimon Josefsson <simon@josefsson.org>
Sun, 20 Feb 2011 19:59:56 +0000 (20:59 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 23 Feb 2011 17:52:47 +0000 (18:52 +0100)
NEWS
doc/manpages/Makefile.am
lib/includes/gnutls/compat.h
lib/libgnutls.map
lib/x509/crq.c

diff --git a/NEWS b/NEWS
index f52bb53c246d65d7c23fd69b6b4e9fb672f77e78..ae47f2d8c266892d25d5725c696b8962d6ba505c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -124,7 +124,7 @@ gnutls_privkey_sign_hash: MODIFIED (was added in 2.11.0)
 gnutls_privkey_sign_data: MODIFIED (was added in 2.11.0)
 gnutls_x509_crq_sign2: DEPRECATED (use: gnutls_x509_crq_privkey_sign)
 gnutls_x509_crq_sign: DEPRECATED (use: gnutls_x509_crq_privkey_sign)
-gnutls_x509_crq_get_preferred_hash_algorithm: DEPRECATED
+gnutls_x509_crq_get_preferred_hash_algorithm: REMOVED (was added in 2.11.0)
 gnutls_x509_crl_sign: DEPRECATED (use: gnutls_x509_crl_privkey_sign)
 gnutls_x509_crl_sign2: DEPRECATED (use: gnutls_x509_crl_privkey_sign)
 gnutls_x509_privkey_sign_data: DEPRECATED (use: gnutls_privkey_sign_data2)
index 340f75178ad2c5d333a57406fa0bd21f670a41ce..f1f707b30a3a33126187c5fb9c1fd2d265c6cfcf 100644 (file)
@@ -439,7 +439,6 @@ APIMANS += gnutls_x509_crq_set_basic_constraints.3
 APIMANS += gnutls_x509_crq_set_key_usage.3
 APIMANS += gnutls_x509_crq_get_key_purpose_oid.3
 APIMANS += gnutls_x509_crq_set_key_purpose_oid.3
-APIMANS += gnutls_x509_crq_get_preferred_hash_algorithm.3
 APIMANS += gnutls_x509_crq_get_key_id.3
 APIMANS += gnutls_x509_crq_privkey_sign.3
 APIMANS += gnutls_x509_dn_init.3
index d7664d47ab0d96c3bfce03d8d5d9690e39fddcf7..5b778c02bae8b03938416c34c84cc151f6a626cb 100644 (file)
@@ -238,11 +238,6 @@ gnutls_sign_callback_get (gnutls_session_t session, void **userdata)
                                                     unsigned int *mand)
                                                     _GNUTLS_GCC_ATTR_DEPRECATED;
 
-  int gnutls_x509_crq_get_preferred_hash_algorithm (gnutls_x509_crq_t crq,
-                                  gnutls_digest_algorithm_t * hash,
-                                  unsigned int *mand)
-                                  _GNUTLS_GCC_ATTR_DEPRECATED;
-
   /* gnutls_x509_crq_privkey_sign() */
   int gnutls_x509_crq_sign2 (gnutls_x509_crq_t crq,
                              gnutls_x509_privkey_t key,
index d04f917497e263112b63dd026bcb53399d793d82..83121442e9cb9e2160a0b9a82245071c39ab50f2 100644 (file)
@@ -668,7 +668,6 @@ GNUTLS_2_12
        gnutls_sec_param_get_name;
        gnutls_pk_bits_to_sec_param;
        gnutls_rnd;
-       gnutls_x509_crq_get_preferred_hash_algorithm;
        gnutls_cipher_encrypt2;
        gnutls_cipher_decrypt2;
        gnutls_openpgp_privkey_sec_param;
index 9e60e2e56429ac2412f60be69a9c601f84e982d7..02dc2c4a80d98dd76e0867018767f3b520ba7482 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2004, 2005, 2008, 2009, 2010 Free Software
+ * Copyright (C) 2003, 2004, 2005, 2008, 2009, 2010, 2011 Free Software
  * Foundation, Inc.
  *
  * Author: Nikos Mavrogiannopoulos
@@ -999,10 +999,6 @@ gnutls_x509_crq_set_challenge_password (gnutls_x509_crq_t crq,
  * This must be the last step in a certificate request generation
  * since all the previously set parameters are now signed.
  *
- * Use gnutls_x509_crq_get_preferred_hash_algorithm() to obtain
- * the digest algorithm to use with the specified public key
- * algorithm.
- *
  * Returns: %GNUTLS_E_SUCCESS on success, otherwise an error.
  *   %GNUTLS_E_ASN1_VALUE_NOT_FOUND is returned if you didn't set all
  *   information in the certificate request (e.g., the version using
@@ -1068,16 +1064,7 @@ fail:
 int
 gnutls_x509_crq_sign (gnutls_x509_crq_t crq, gnutls_x509_privkey_t key)
 {
-  gnutls_digest_algorithm_t dig;
-  int ret = gnutls_x509_crq_get_preferred_hash_algorithm (crq, &dig, NULL);
-
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      return ret;
-    }
-
-  return gnutls_x509_crq_sign2 (crq, key, dig, 0);
+  return gnutls_x509_crq_sign2 (crq, key, GNUTLS_DIG_SHA1, 0);
 }
 
 /**
@@ -2280,59 +2267,6 @@ gnutls_x509_crq_set_key_purpose_oid (gnutls_x509_crq_t crq,
   return 0;
 }
 
-/**
- * gnutls_x509_crq_get_preferred_hash_algorithm:
- * @crq: Holds the certificate
- * @hash: The result of the call with the hash algorithm used for signature
- * @mand: If non zero it means that the algorithm MUST use this hash. May be NULL.
- *
- * This function will read the certifcate and return the appropriate digest
- * algorithm to use for signing with this certificate. Some certificates (i.e.
- * DSA might not be able to sign without the preferred algorithm).
- *
- * Returns: the 0 if the hash algorithm is found. A negative value is
- * returned on error.
- *
- * Since: 2.11.0
- **/
-int
-gnutls_x509_crq_get_preferred_hash_algorithm (gnutls_x509_crq_t crq,
-                                              gnutls_digest_algorithm_t *
-                                              hash, unsigned int *mand)
-{
-  bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
-  int params_size;
-  int ret, i;
-
-  if (crq == NULL)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_INVALID_REQUEST;
-    }
-
-  params_size = MAX_PUBLIC_PARAMS_SIZE;
-  ret = _gnutls_x509_crq_get_mpis (crq, params, &params_size);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      return ret;
-    }
-
-  ret =
-    _gnutls_pk_get_hash_algorithm (gnutls_x509_crq_get_pk_algorithm
-                                   (crq, NULL), params, params_size, hash,
-                                   mand);
-
-  /* release allocated mpis */
-  for (i = 0; i < params_size; i++)
-    {
-      _gnutls_mpi_release (&params[i]);
-    }
-
-  return ret;
-}
-
-
 static int
 rsadsa_crq_get_key_id (gnutls_x509_crq_t crq, int pk,
                        unsigned char *output_data, size_t * output_data_size)