gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_2_11_6-38-g920774d


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_11_6-38-g920774d
Date: Sun, 19 Dec 2010 01:46:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=920774dd19cb84e6781e5043a6d0e87801a69cf5

The branch, master has been updated
       via  920774dd19cb84e6781e5043a6d0e87801a69cf5 (commit)
      from  8cd6a6c32aab34fe9a9bb7e3f0420752ff43e8e2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 920774dd19cb84e6781e5043a6d0e87801a69cf5
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Dec 19 02:42:34 2010 +0100

    Removed the newly added functions:
    gnutls_openpgp_privkey_sign_hash2(),
    gnutls_openpgp_privkey_sign_data2(),
    gnutls_openpgp_crt_verify_hash()
    That way the operations in abstract.h should be used
    to get the same functionality, and API will be kept simple
    and easier to maintain. The corresponding gnutls_x509_* are
    kept for backwards compatibility.

-----------------------------------------------------------------------

Summary of changes:
 NEWS                          |   12 ++--
 lib/gnutls_privkey.c          |    2 +-
 lib/includes/gnutls/openpgp.h |   21 -------
 lib/openpgp/gnutls_openpgp.h  |    6 ++
 lib/openpgp/pgp.c             |   55 ------------------
 lib/openpgp/privkey.c         |  122 +---------------------------------------
 6 files changed, 16 insertions(+), 202 deletions(-)

diff --git a/NEWS b/NEWS
index b61d12d..ab4b206 100644
--- a/NEWS
+++ b/NEWS
@@ -30,20 +30,18 @@ Reported by "Brendan Doherty" <address@hidden>.
 ** API and ABI modifications:
 gnutls_pubkey_import_privkey: ADDED
 gnutls_pubkey_verify_data: ADDED
+gnutls_privkey_sign_hash2: ADDED
 gnutls_pkcs11_privkey_sign_hash2: ADDED
-gnutls_openpgp_privkey_sign_hash2: ADDED
 gnutls_x509_privkey_sign_hash2: ADDED
-gnutls_privkey_sign_hash2: ADDED
-gnutls_openpgp_privkey_sign_data2: ADDED
 gnutls_x509_privkey_sign_data2: ADDED
-gnutls_openpgp_crt_verify_hash: ADDED
-gnutls_openpgp_privkey_sign_hash: REMOVED
-gnutls_pkcs11_privkey_sign_hash: REMOVED
-gnutls_privkey_sign_hash: REMOVED
 gnutls_x509_privkey_sign_hash: DEPRECATED
 gnutls_psk_netconf_derive_key: DEPRECATED
 gnutls_session_set_finished_function: DEPRECATED
 gnutls_ext_register: DEPRECATED
+gnutls_openpgp_privkey_sign_hash: REMOVED
+gnutls_openpgp_privkey_decrypt_data: REMOVED
+gnutls_pkcs11_privkey_sign_hash: REMOVED
+gnutls_privkey_sign_hash: REMOVED
 
 * Version 2.11.6 (released 2010-12-06)
 
diff --git a/lib/gnutls_privkey.c b/lib/gnutls_privkey.c
index fdd8b18..553efd2 100644
--- a/lib/gnutls_privkey.c
+++ b/lib/gnutls_privkey.c
@@ -538,7 +538,7 @@ gnutls_privkey_decrypt_data (gnutls_privkey_t key,
     {
 #ifdef ENABLE_OPENPGP
     case GNUTLS_PRIVKEY_OPENPGP:
-      return gnutls_openpgp_privkey_decrypt_data (key->key.openpgp, flags,
+      return _gnutls_openpgp_privkey_decrypt_data (key->key.openpgp, flags,
                                                   ciphertext, plaintext);
 #endif
     case GNUTLS_PRIVKEY_X509:
diff --git a/lib/includes/gnutls/openpgp.h b/lib/includes/gnutls/openpgp.h
index 7929107..4b0d853 100644
--- a/lib/includes/gnutls/openpgp.h
+++ b/lib/includes/gnutls/openpgp.h
@@ -169,27 +169,6 @@ extern "C"
                                      const char *password,
                                      unsigned int flags);
 
-  int gnutls_openpgp_privkey_sign_hash2 (gnutls_openpgp_privkey_t signer,
-                                         gnutls_digest_algorithm_t hash_algo,
-                                         unsigned int flags,
-                                         const gnutls_datum_t * hash_data,
-                                         gnutls_datum_t * signature);
-
-  int gnutls_openpgp_crt_verify_hash (gnutls_openpgp_crt_t crt,
-                                      unsigned int flags,
-                                      const gnutls_datum_t * hash,
-                                      const gnutls_datum_t * signature);
-
-  int gnutls_openpgp_privkey_sign_data2 (gnutls_openpgp_privkey_t signer,
-                                         gnutls_digest_algorithm_t hash,
-                                         unsigned int flags,
-                                         const gnutls_datum_t * data,
-                                         gnutls_datum_t * signature);
-
-  int gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key,
-                                           unsigned int flags,
-                                           const gnutls_datum_t * ciphertext,
-                                           gnutls_datum_t * plaintext);
   int gnutls_openpgp_privkey_get_fingerprint (gnutls_openpgp_privkey_t key,
                                               void *fpr, size_t * fprlen);
   int gnutls_openpgp_privkey_get_subkey_fingerprint (gnutls_openpgp_privkey_t
diff --git a/lib/openpgp/gnutls_openpgp.h b/lib/openpgp/gnutls_openpgp.h
index f30b563..7816fcd 100644
--- a/lib/openpgp/gnutls_openpgp.h
+++ b/lib/openpgp/gnutls_openpgp.h
@@ -55,6 +55,12 @@ _gnutls_openpgp_privkey_sign_hash (gnutls_openpgp_privkey_t 
key,
                                    gnutls_datum_t * signature);
 
 
+int
+_gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key,
+                                     unsigned int flags,
+                                     const gnutls_datum_t * ciphertext,
+                                     gnutls_datum_t * plaintext);
+
 #endif /*GNUTLS_OPENPGP_LOCAL_H */
 
 #endif /*ENABLE_OPENPGP */
diff --git a/lib/openpgp/pgp.c b/lib/openpgp/pgp.c
index 409711c..01f7a70 100644
--- a/lib/openpgp/pgp.c
+++ b/lib/openpgp/pgp.c
@@ -1688,58 +1688,3 @@ gnutls_openpgp_crt_get_auth_subkey (gnutls_openpgp_crt_t 
crt,
     return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE;
 }
 
-/**
- * gnutls_openpgp_crt_verify_hash:
- * @crt: Holds the certificate
- * @flags: should be 0 for now
- * @hash: holds the hash digest to be verified
- * @signature: contains the signature
- *
- * This function will verify the given signed digest, using the
- * parameters from the certificate.
- *
- * Returns: In case of a verification failure %GNUTLS_E_PK_SIG_VERIFY_FAILED 
- * is returned, and a positive code on success.
- **/
-int
-gnutls_openpgp_crt_verify_hash (gnutls_openpgp_crt_t crt, unsigned int flags,
-                                const gnutls_datum_t * hash,
-                                const gnutls_datum_t * signature)
-{
-  int ret;
-  bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
-  int params_size = MAX_PUBLIC_PARAMS_SIZE;
-  gnutls_pk_algorithm_t pk;
-  uint32_t kid[2];
-
-  if (crt == NULL || !crt->preferred_set)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_INVALID_REQUEST;
-    }
-
-  ret = gnutls_openpgp_crt_get_pk_algorithm (crt, NULL);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      return ret;
-    }
-  pk = ret;
-
-  KEYID_IMPORT (kid, crt->preferred_keyid);
-  ret = _gnutls_openpgp_crt_get_mpis (crt, kid, params, &params_size);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      return ret;
-    }
-
-  ret = pubkey_verify_sig (NULL, hash, signature, pk, params, params_size);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      return ret;
-    }
-
-  return ret;
-}
diff --git a/lib/openpgp/privkey.c b/lib/openpgp/privkey.c
index 304fc9d..b727635 100644
--- a/lib/openpgp/privkey.c
+++ b/lib/openpgp/privkey.c
@@ -1298,122 +1298,8 @@ _gnutls_openpgp_privkey_sign_hash 
(gnutls_openpgp_privkey_t key,
   return 0;
 }
 
-/**
- * gnutls_openpgp_privkey_sign_hash2:
- * @signer: Holds the signer's key
- * @hash_algo: The hash algorithm used
- * @hash_data: holds the data to be signed
- * @signature: will contain newly allocated signature
- * @flags: zero for now
- *
- * This function will sign the given hash using the private key.  You
- * should use gnutls_openpgp_privkey_set_preferred_key_id() before
- * calling this function to set the subkey to use.
- *
- * Returns: On success, %GNUTLS_E_SUCCESS is returned, otherwise a
- *   negative error value.
- **/
-int
-gnutls_openpgp_privkey_sign_hash2 (gnutls_openpgp_privkey_t signer,
-                                   gnutls_digest_algorithm_t hash_algo,
-                                   unsigned int flags,
-                                   const gnutls_datum_t * hash_data,
-                                   gnutls_datum_t * signature)
-{
-  int ret;
-  gnutls_datum_t digest;
-
-  digest.data = gnutls_malloc (hash_data->size);
-  if (digest.data == NULL)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_MEMORY_ERROR;
-    }
-  digest.size = hash_data->size;
-  memcpy (digest.data, hash_data->data, digest.size);
-
-  ret =
-    pk_prepare_hash (gnutls_openpgp_privkey_get_pk_algorithm (signer, NULL),
-                     hash_algo, &digest);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      goto cleanup;
-    }
-
-  ret = _gnutls_openpgp_privkey_sign_hash (signer, &digest, signature);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      goto cleanup;
-    }
-
-  ret = 0;
-
-cleanup:
-  _gnutls_free_datum (&digest);
-  return ret;
-}
-
-/**
- * gnutls_openpgp_privkey_sign_data2:
- * @signer: Holds the key
- * @digest: should be MD5 or SHA1
- * @flags: should be 0 for now
- * @data: holds the data to be signed
- * @signature: will contain the signature allocate with gnutls_malloc()
- *
- * This function will sign the given data using a signature algorithm
- * supported by the private key. Signature algorithms are always used
- * together with a hash functions.  Different hash functions may be
- * used for the RSA algorithm, but only SHA-XXX for the DSA keys.
- *
- * The RSA algorithm is used in PKCS #1 v1.5 mode.
- *
- * If the buffer provided is not long enough to hold the output, then
- * address@hidden is updated and %GNUTLS_E_SHORT_MEMORY_BUFFER will
- * be returned.
- *
- * Returns: On success, %GNUTLS_E_SUCCESS is returned, otherwise a
- *   negative error value.
- **/
-int
-gnutls_openpgp_privkey_sign_data2 (gnutls_openpgp_privkey_t signer,
-                                   gnutls_digest_algorithm_t hash,
-                                   unsigned int flags,
-                                   const gnutls_datum_t * data,
-                                   gnutls_datum_t * signature)
-{
-  int ret;
-  gnutls_datum_t digest;
-
-  ret =
-    pk_hash_data (gnutls_openpgp_privkey_get_pk_algorithm (signer, NULL),
-                  hash, NULL, data, &digest);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      return ret;
-    }
-
-  ret =
-    gnutls_openpgp_privkey_sign_hash2 (signer, hash, flags, &digest,
-                                       signature);
-  if (ret < 0)
-    {
-      gnutls_assert ();
-      goto cleanup;
-    }
-
-  ret = 0;
-
-cleanup:
-  _gnutls_free_datum (&digest);
-  return ret;
-}
-
-/**
- * gnutls_openpgp_privkey_decrypt_data:
+/*-
+ * _gnutls_openpgp_privkey_decrypt_data:
  * @key: Holds the key
  * @flags: zero for now
  * @ciphertext: holds the data to be decrypted
@@ -1425,9 +1311,9 @@ cleanup:
  *
  * Returns: On success, %GNUTLS_E_SUCCESS is returned, otherwise a
  *   negative error value.
- **/
+ -*/
 int
-gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key,
+_gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key,
                                      unsigned int flags,
                                      const gnutls_datum_t * ciphertext,
                                      gnutls_datum_t * plaintext)


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]