gnome-keyring r1370 - in trunk: . common daemon/ssh
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-keyring r1370 - in trunk: . common daemon/ssh
- Date: Tue, 11 Nov 2008 17:03:40 +0000 (UTC)
Author: nnielsen
Date: Tue Nov 11 17:03:39 2008
New Revision: 1370
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1370&view=rev
Log:
* common/gkr-crypto.c:
* common/gkr-location-watch.c:
* daemon/ssh/gkr-ssh-daemon-ops.c: Better warnings and debug messages
in certain corner cases.
Modified:
trunk/ChangeLog
trunk/common/gkr-crypto.c
trunk/common/gkr-location-watch.c
trunk/daemon/ssh/gkr-ssh-daemon-ops.c
Modified: trunk/common/gkr-crypto.c
==============================================================================
--- trunk/common/gkr-crypto.c (original)
+++ trunk/common/gkr-crypto.c Tue Nov 11 17:03:39 2008
@@ -875,6 +875,8 @@
{
guchar hash[20];
+ g_return_val_if_fail (s_key != NULL, NULL);
+
if (!gcry_pk_get_keygrip (s_key, hash))
g_return_val_if_reached (NULL);
Modified: trunk/common/gkr-location-watch.c
==============================================================================
--- trunk/common/gkr-location-watch.c (original)
+++ trunk/common/gkr-location-watch.c Tue Nov 11 17:03:39 2008
@@ -211,14 +211,16 @@
g_assert (file);
ret = g_stat (file, &sb);
lasterr = errno;
- g_free (file);
/* Couldn't access the file */
if (ret < 0) {
- g_message ("couldn't stat file: %s: %s", path, g_strerror (lasterr));
+ g_message ("couldn't stat file: %s: %s", file, g_strerror (lasterr));
+ g_free (file);
continue;
}
+ g_free (file);
+
/* We don't do directories */
if (sb.st_mode & S_IFDIR)
continue;
Modified: trunk/daemon/ssh/gkr-ssh-daemon-ops.c
==============================================================================
--- trunk/daemon/ssh/gkr-ssh-daemon-ops.c (original)
+++ trunk/daemon/ssh/gkr-ssh-daemon-ops.c Tue Nov 11 17:03:39 2008
@@ -106,6 +106,8 @@
GkrPkPrivkey *key = NULL;
gkrid keyid;
+ g_assert (skey);
+
keyid = gkr_crypto_skey_make_id (skey);
g_return_val_if_fail (keyid != NULL, NULL);
@@ -135,6 +137,8 @@
add_session_key (gcry_sexp_t skey, const gchar *comment, guint version)
{
GkrPkPrivkey *key, *prev;
+
+ g_assert (skey);
if (!ssh_session) {
ssh_session = gkr_pk_session_new ();
@@ -416,6 +420,8 @@
/* The key itself */
if (!gkr_ssh_proto_read_public (req, &offset, &s_key, &algo))
return FALSE;
+
+ g_return_val_if_fail (s_key, FALSE);
if (!gkr_buffer_get_byte_array (req, offset, &offset, &data, &n_data) ||
!gkr_buffer_get_uint32 (req, offset, &offset, &flags)) {
@@ -539,6 +545,8 @@
if (!gkr_ssh_proto_read_public_v1 (req, &offset, &skey))
return FALSE;
+ g_return_val_if_fail (skey, FALSE);
+
/* Lookup the key */
key = find_private_key (skey, TRUE, 1);
gcry_sexp_release (skey);
@@ -657,6 +665,8 @@
if (!gkr_ssh_proto_read_public (req, &offset, &skey, NULL))
return FALSE;
+ g_return_val_if_fail (skey, FALSE);
+
key = find_private_key (skey, TRUE, 2);
gcry_sexp_release (skey);
@@ -694,6 +704,8 @@
if (!gkr_ssh_proto_read_public_v1 (req, &offset, &skey))
return FALSE;
+ g_return_val_if_fail (skey, FALSE);
+
key = find_private_key (skey, FALSE, 1);
gcry_sexp_release (skey);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]