gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, gnutls_2_10_x, updated. gnutls_2_10_5-4-g4eeba9


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_2_10_x, updated. gnutls_2_10_5-4-g4eeba9b
Date: Sat, 26 Mar 2011 00:15:22 +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=4eeba9b38b63d2aa7fd091c00c753b30b78e0209

The branch, gnutls_2_10_x has been updated
       via  4eeba9b38b63d2aa7fd091c00c753b30b78e0209 (commit)
       via  1cf779b5b1807c881008f42bf545b9fa9783f96f (commit)
       via  1de03956c89f7ab4aee209cf3afe13d814f57f3d (commit)
       via  f02d56a76e4ac5a6ebc65e5277250cbe73ba6ca0 (commit)
      from  65c8d4d228993dc7c6f36cdb8b11355bf4c7814e (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 4eeba9b38b63d2aa7fd091c00c753b30b78e0209
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Mar 25 20:18:00 2011 +0100

    Fix size of gnutls_openpgp_keyid_t by using the GNUTLS_OPENPGP_KEYID_SIZE 
definition.
    Reported by Andreas Metzler.

commit 1cf779b5b1807c881008f42bf545b9fa9783f96f
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Mar 25 20:31:11 2011 +0100

    Corrected uninitialized var deinitiation. Reported by Vitaly Kruglikov.

commit 1de03956c89f7ab4aee209cf3afe13d814f57f3d
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Mar 26 01:14:15 2011 +0100

    fix for C++.

commit f02d56a76e4ac5a6ebc65e5277250cbe73ba6ca0
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Mar 26 01:01:17 2011 +0100

    Corrected access to freed memory location. Reported by Vitaly Kruglikov.

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

Summary of changes:
 lib/includes/gnutls/compat.h  |    9 +++++++++
 lib/includes/gnutls/openpgp.h |    3 ++-
 lib/opencdk/stream.c          |   26 ++++++++++++++------------
 lib/opencdk/verify.c          |    2 ++
 lib/openpgp/gnutls_openpgp.c  |    9 +++++----
 lib/openpgp/pgp.c             |    4 ++--
 lib/openpgp/privkey.c         |    4 ++--
 7 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/lib/includes/gnutls/compat.h b/lib/includes/gnutls/compat.h
index 0232103..23d5ced 100644
--- a/lib/includes/gnutls/compat.h
+++ b/lib/includes/gnutls/compat.h
@@ -3,6 +3,11 @@
 #ifndef GNUTLS_COMPAT_H
 # define GNUTLS_COMPAT_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 #define gnutls_cipher_algorithm gnutls_cipher_algorithm_t
 #define gnutls_kx_algorithm gnutls_kx_algorithm_t
 #define gnutls_paramsype gnutls_paramsype_t
@@ -98,4 +103,8 @@
 #define LIBGNUTLS_VERSION_NUMBER GNUTLS_VERSION_NUMBER
 #define LIBGNUTLS_EXTRA_VERSION GNUTLS_VERSION
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GNUTLS_COMPAT_H */
diff --git a/lib/includes/gnutls/openpgp.h b/lib/includes/gnutls/openpgp.h
index 78cec82..8ea994a 100644
--- a/lib/includes/gnutls/openpgp.h
+++ b/lib/includes/gnutls/openpgp.h
@@ -53,7 +53,8 @@ extern "C"
     GNUTLS_OPENPGP_FMT_BASE64
   } gnutls_openpgp_crt_fmt_t;
 
-  typedef unsigned char gnutls_openpgp_keyid_t[8];
+#define GNUTLS_OPENPGP_KEYID_SIZE 8
+  typedef unsigned char gnutls_openpgp_keyid_t[GNUTLS_OPENPGP_KEYID_SIZE];
 
 /* gnutls_openpgp_cert_t should be defined in gnutls.h
  */
diff --git a/lib/opencdk/stream.c b/lib/opencdk/stream.c
index 4dfa8f1..0f3660f 100644
--- a/lib/opencdk/stream.c
+++ b/lib/opencdk/stream.c
@@ -761,6 +761,7 @@ stream_fp_replace (cdk_stream_t s, FILE ** tmp)
   rc = fclose (s->fp);
   if (rc)
     {
+      s->fp = NULL;
       gnutls_assert ();
       return CDK_File_Error;
     }
@@ -819,11 +820,12 @@ stream_filter_write (cdk_stream_t s)
       if (!rc)
        rc = cdk_stream_seek (s, 0);
       if (rc)
-       {
-         _cdk_log_debug ("filter [close]: fd=%d\n", fileno (f->tmp));
-         fclose (f->tmp);
-         break;
-       }
+        {
+          _gnutls_read_log ("filter [close]: fd=%d\n", fileno (f->tmp));
+          fclose (f->tmp);
+          f->tmp = NULL;
+          break;
+        }
     }
   return rc;
 }
@@ -958,13 +960,13 @@ cdk_stream_read (cdk_stream_t s, void *buf, size_t buflen)
     {
       rc = stream_filter_read (s);
       if (rc)
-       {
-         s->error = rc;
-         if (feof (s->fp))
-           s->flags.eof = 1;
-         gnutls_assert ();
-         return EOF;
-       }
+        {
+          s->error = rc;
+          if (s->fp && feof (s->fp))
+            s->flags.eof = 1;
+          gnutls_assert ();
+          return EOF;
+        }
       s->flags.filtrated = 1;
     }
 
diff --git a/lib/opencdk/verify.c b/lib/opencdk/verify.c
index ab1638d..1f69104 100644
--- a/lib/opencdk/verify.c
+++ b/lib/opencdk/verify.c
@@ -179,6 +179,8 @@ file_verify_clearsign (cdk_ctx_t hd, const char *file, 
const char *output)
   int err;
   cdk_error_t rc;
 
+  memset(&md, 0, sizeof(md));
+
   if (output)
     {
       rc = cdk_stream_create (output, &out);
diff --git a/lib/openpgp/gnutls_openpgp.c b/lib/openpgp/gnutls_openpgp.c
index 90246f8..d6c4ef2 100644
--- a/lib/openpgp/gnutls_openpgp.c
+++ b/lib/openpgp/gnutls_openpgp.c
@@ -322,7 +322,7 @@ gnutls_certificate_set_openpgp_key_file 
(gnutls_certificate_credentials_t res,
 static int
 get_keyid (gnutls_openpgp_keyid_t keyid, const char *str)
 {
-  size_t keyid_size = sizeof (keyid);
+  size_t keyid_size = GNUTLS_OPENPGP_KEYID_SIZE;
 
   if (strlen (str) != 16)
     {
@@ -811,8 +811,9 @@ _gnutls_openpgp_crt_to_gcert (gnutls_cert * gcert, 
gnutls_openpgp_crt_t cert)
       uint32_t kid32[2];
 
       _gnutls_debug_log
-       ("Importing Openpgp cert and using openpgp sub key: %s\n",
-        _gnutls_bin2hex (keyid, sizeof (keyid), err_buf, sizeof (err_buf)));
+        ("Importing Openpgp cert and using openpgp sub key: %s\n",
+         _gnutls_bin2hex (keyid, GNUTLS_OPENPGP_KEYID_SIZE, err_buf, sizeof 
(err_buf),
+                          NULL));
 
       KEYID_IMPORT (kid32, keyid);
 
@@ -829,7 +830,7 @@ _gnutls_openpgp_crt_to_gcert (gnutls_cert * gcert, 
gnutls_openpgp_crt_t cert)
       gnutls_openpgp_crt_get_subkey_usage (cert, idx, &gcert->key_usage);
       gcert->use_subkey = 1;
 
-      memcpy (gcert->subkey_id, keyid, sizeof (keyid));
+      memcpy (gcert->subkey_id, keyid, GNUTLS_OPENPGP_KEYID_SIZE);
 
       ret =
        _gnutls_openpgp_crt_get_mpis (cert, kid32, gcert->params,
diff --git a/lib/openpgp/pgp.c b/lib/openpgp/pgp.c
index 3483243..e592558 100644
--- a/lib/openpgp/pgp.c
+++ b/lib/openpgp/pgp.c
@@ -1560,7 +1560,7 @@ gnutls_openpgp_crt_get_preferred_key_id 
(gnutls_openpgp_crt_t key,
       return GNUTLS_E_INVALID_REQUEST;
     }
 
-  memcpy (keyid, key->preferred_keyid, sizeof (gnutls_openpgp_keyid_t));
+  memcpy (keyid, key->preferred_keyid, GNUTLS_OPENPGP_KEYID_SIZE);
 
   return 0;
 }
@@ -1598,7 +1598,7 @@ gnutls_openpgp_crt_set_preferred_key_id 
(gnutls_openpgp_crt_t key,
     }
 
   key->preferred_set = 1;
-  memcpy (key->preferred_keyid, keyid, sizeof (gnutls_openpgp_keyid_t));
+  memcpy (key->preferred_keyid, keyid, GNUTLS_OPENPGP_KEYID_SIZE);
 
   return 0;
 }
diff --git a/lib/openpgp/privkey.c b/lib/openpgp/privkey.c
index bc4c635..77a14de 100644
--- a/lib/openpgp/privkey.c
+++ b/lib/openpgp/privkey.c
@@ -1140,7 +1140,7 @@ gnutls_openpgp_privkey_get_preferred_key_id 
(gnutls_openpgp_privkey_t key,
       return GNUTLS_E_INVALID_REQUEST;
     }
 
-  memcpy (keyid, key->preferred_keyid, sizeof (gnutls_openpgp_keyid_t));
+  memcpy (keyid, key->preferred_keyid, GNUTLS_OPENPGP_KEYID_SIZE);
 
   return 0;
 }
@@ -1178,7 +1178,7 @@ gnutls_openpgp_privkey_set_preferred_key_id 
(gnutls_openpgp_privkey_t key,
     }
 
   key->preferred_set = 1;
-  memcpy (key->preferred_keyid, keyid, sizeof (gnutls_openpgp_keyid_t));
+  memcpy (key->preferred_keyid, keyid, GNUTLS_OPENPGP_KEYID_SIZE);
 
   return 0;
 }


hooks/post-receive
-- 
GNU gnutls



reply via email to

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