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-48-ge1034a0


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_11_6-48-ge1034a0
Date: Tue, 21 Dec 2010 20:40:20 +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=e1034a02f0e5f817f7d22182c902648f288f78f3

The branch, master has been updated
       via  e1034a02f0e5f817f7d22182c902648f288f78f3 (commit)
       via  332761134770fb0a9b6e1f0a002aa433e34114a5 (commit)
       via  7a085ad284ffef791dc063b500738fabcb5e7931 (commit)
       via  572888e8dfa8eb5a7fa951c4e577887bfe97b250 (commit)
      from  b75633f79e5fccb89bb256956dea1eece27b9adb (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 e1034a02f0e5f817f7d22182c902648f288f78f3
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Tue Dec 21 21:39:05 2010 +0100

    Renamed gnutls_privkey_sign_data() to  gnutls_privkey_sign_data2() to match 
the
    similar function gnutls_x509_privkey_sign_data2().
    gnutls_x509_privkey_sign_data() was deprecated.

commit 332761134770fb0a9b6e1f0a002aa433e34114a5
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Dec 19 13:15:01 2010 +0100

    Extra sanity check.

commit 7a085ad284ffef791dc063b500738fabcb5e7931
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Dec 19 13:14:49 2010 +0100

    Use snprintf() to print an integer.

commit 572888e8dfa8eb5a7fa951c4e577887bfe97b250
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Dec 19 13:08:47 2010 +0100

    Use snprintf() to print IPs. There was a check just before that, but be 
safe, just in case.

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

Summary of changes:
 NEWS                           |    2 ++
 lib/auth_srp_passwd.c          |    2 +-
 lib/gnutls_privkey.c           |    2 +-
 lib/gnutls_str.c               |    6 ++++++
 lib/includes/gnutls/abstract.h |    2 +-
 lib/includes/gnutls/compat.h   |   10 ++++++++++
 lib/includes/gnutls/x509.h     |    6 ------
 lib/x509/crq.c                 |    2 +-
 lib/x509/output.c              |    4 ++--
 lib/x509/privkey.c             |    6 +++---
 lib/x509/sign.c                |    2 +-
 11 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/NEWS b/NEWS
index 8ed595d..c7df258 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,8 @@ gnutls_pubkey_verify_data: ADDED
 gnutls_privkey_sign_hash2: ADDED
 gnutls_x509_privkey_sign_hash2: ADDED
 gnutls_x509_privkey_sign_data2: ADDED
+gnutls_privkey_sign_data2: ADDED (in place of gnutls_privkey_sign_data)
+gnutls_x509_privkey_sign_data: DEPRECATED
 gnutls_x509_privkey_sign_hash: DEPRECATED
 gnutls_x509_privkey_verify_data: DEPRECATED
 gnutls_psk_netconf_derive_key: DEPRECATED
diff --git a/lib/auth_srp_passwd.c b/lib/auth_srp_passwd.c
index 5616377..370f845 100644
--- a/lib/auth_srp_passwd.c
+++ b/lib/auth_srp_passwd.c
@@ -210,7 +210,7 @@ pwd_read_conf (const char *pconf_file, SRP_PWD_ENTRY * 
entry, int idx)
   unsigned i, len;
   char indexstr[10];
 
-  sprintf (indexstr, "%d", idx);        /* Flawfinder: ignore */
+  snprintf (indexstr, sizeof(indexstr), "%u", (unsigned int)idx);
 
   fd = fopen (pconf_file, "r");
   if (fd == NULL)
diff --git a/lib/gnutls_privkey.c b/lib/gnutls_privkey.c
index 35f6a33..042b598 100644
--- a/lib/gnutls_privkey.c
+++ b/lib/gnutls_privkey.c
@@ -374,7 +374,7 @@ gnutls_privkey_import_openpgp (gnutls_privkey_t pkey,
  * negative error value.
  **/
 int
-gnutls_privkey_sign_data (gnutls_privkey_t signer,
+gnutls_privkey_sign_data2 (gnutls_privkey_t signer,
                           gnutls_digest_algorithm_t hash,
                           unsigned int flags,
                           const gnutls_datum_t * data,
diff --git a/lib/gnutls_str.c b/lib/gnutls_str.c
index a28b2b3..4b6fc63 100644
--- a/lib/gnutls_str.c
+++ b/lib/gnutls_str.c
@@ -431,6 +431,12 @@ _gnutls_bin2hex (const void *_old, size_t oldlen,
   else
     separator = empty;
 
+  if (buffer_size < 3)
+    {
+      gnutls_assert();
+      return NULL;
+    }
+
   i = j = 0;
   sprintf (&buffer[j], "%.2x", old[i]);
   j += 2;
diff --git a/lib/includes/gnutls/abstract.h b/lib/includes/gnutls/abstract.h
index 8f024cb..b4c1b30 100644
--- a/lib/includes/gnutls/abstract.h
+++ b/lib/includes/gnutls/abstract.h
@@ -108,7 +108,7 @@ int gnutls_privkey_import_openpgp (gnutls_privkey_t pkey,
                                    gnutls_openpgp_privkey_t key,
                                    unsigned int flags);
 
-int gnutls_privkey_sign_data (gnutls_privkey_t signer,
+int gnutls_privkey_sign_data2 (gnutls_privkey_t signer,
                               gnutls_digest_algorithm_t hash,
                               unsigned int flags,
                               const gnutls_datum_t * data,
diff --git a/lib/includes/gnutls/compat.h b/lib/includes/gnutls/compat.h
index 2f05bbe..926f233 100644
--- a/lib/includes/gnutls/compat.h
+++ b/lib/includes/gnutls/compat.h
@@ -234,4 +234,14 @@ gnutls_sign_callback_get (gnutls_session_t session, void 
**userdata)
                                        const gnutls_datum_t * signature)
                                        _GNUTLS_GCC_ATTR_DEPRECATED;
 
+/* we support the gnutls_x509_privkey_sign_data2() instead.
+ */
+  int gnutls_x509_privkey_sign_data (gnutls_x509_privkey_t key,
+                                     gnutls_digest_algorithm_t digest,
+                                     unsigned int flags,
+                                     const gnutls_datum_t * data,
+                                     void *signature,
+                                     size_t * signature_size)
+                                     _GNUTLS_GCC_ATTR_DEPRECATED;
+
 #endif /* _GNUTLS_COMPAT_H */
diff --git a/lib/includes/gnutls/x509.h b/lib/includes/gnutls/x509.h
index 5221b95..d192288 100644
--- a/lib/includes/gnutls/x509.h
+++ b/lib/includes/gnutls/x509.h
@@ -710,12 +710,6 @@ extern "C"
 
 /* Signing stuff.
  */
-  int gnutls_x509_privkey_sign_data (gnutls_x509_privkey_t key,
-                                     gnutls_digest_algorithm_t digest,
-                                     unsigned int flags,
-                                     const gnutls_datum_t * data,
-                                     void *signature,
-                                     size_t * signature_size);
   int gnutls_x509_privkey_sign_data2 (gnutls_x509_privkey_t key,
                                       gnutls_digest_algorithm_t digest,
                                       unsigned int flags,
diff --git a/lib/x509/crq.c b/lib/x509/crq.c
index c51ce8d..577d7e2 100644
--- a/lib/x509/crq.c
+++ b/lib/x509/crq.c
@@ -2546,7 +2546,7 @@ gnutls_x509_crq_privkey_sign (gnutls_x509_crq_t crq, 
gnutls_privkey_t key,
       return result;
     }
 
-  result = gnutls_privkey_sign_data (key, dig, 0, &tbs, &signature);
+  result = gnutls_privkey_sign_data2 (key, dig, 0, &tbs, &signature);
   gnutls_free (tbs.data);
 
   if (result < 0)
diff --git a/lib/x509/output.c b/lib/x509/output.c
index 8583f15..a3e62f2 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -121,10 +121,10 @@ ip_to_string (void *_ip, int ip_size, char *string, int 
string_size)
   switch (ip_size)
     {
     case 4:
-      sprintf (string, "%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
+      snprintf (string, string_size, "%u.%u.%u.%u", ip[0], ip[1], ip[2], 
ip[3]);
       break;
     case 16:
-      sprintf (string, "%x:%x:%x:%x:%x:%x:%x:%x",
+      snprintf (string, string_size, "%x:%x:%x:%x:%x:%x:%x:%x",
                (ip[0] << 8) | ip[1], (ip[2] << 8) | ip[3],
                (ip[4] << 8) | ip[5], (ip[6] << 8) | ip[7],
                (ip[8] << 8) | ip[9], (ip[10] << 8) | ip[11],
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index 9ddb2e8..5317dbc 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -1653,6 +1653,7 @@ cleanup:
 }
 
 
+#ifdef ENABLE_PKI
 /**
  * gnutls_x509_privkey_sign_data2:
  * @signer: Holds the key
@@ -1816,8 +1817,7 @@ cleanup:
   return ret;
 }
 
-#ifdef ENABLE_PKI
-/**
+/*-
  * gnutls_x509_privkey_sign_data:
  * @key: Holds the key
  * @digest: should be MD5 or SHA1
@@ -1841,7 +1841,7 @@ cleanup:
  *
  * Returns: On success, %GNUTLS_E_SUCCESS is returned, otherwise a
  *   negative error value.
- **/
+ -*/
 int
 gnutls_x509_privkey_sign_data (gnutls_x509_privkey_t key,
                                gnutls_digest_algorithm_t digest,
diff --git a/lib/x509/sign.c b/lib/x509/sign.c
index 7860855..6897b35 100644
--- a/lib/x509/sign.c
+++ b/lib/x509/sign.c
@@ -138,7 +138,7 @@ _gnutls_x509_pkix_sign (ASN1_TYPE src, const char *src_name,
       return result;
     }
 
-  result = gnutls_privkey_sign_data (issuer_key, dig, 0, &tbs, &signature);
+  result = gnutls_privkey_sign_data2 (issuer_key, dig, 0, &tbs, &signature);
   gnutls_free (tbs.data);
 
   if (result < 0)


hooks/post-receive
-- 
GNU gnutls



reply via email to

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