aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Schulz <[email protected]>2002-06-14 11:14:41 +0000
committerTimo Schulz <[email protected]>2002-06-14 11:14:41 +0000
commit08ad6bc15929396e021aa23a11fa0d86463f6c03 (patch)
treebbbbd0a8698b4ef78c97a0602c27bc4700208784
parent* keyserver.c (keyserver_spawn): Properly handle PROGRAM responses when (diff)
downloadgnupg-08ad6bc15929396e021aa23a11fa0d86463f6c03.tar.gz
gnupg-08ad6bc15929396e021aa23a11fa0d86463f6c03.zip
2002-06-14 Timo Schulz <[email protected]>
* skclist.c (is_insecure): Implemented.
-rw-r--r--g10/ChangeLog4
-rw-r--r--g10/skclist.c25
2 files changed, 26 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 9d6a27305..1c03c47a9 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,7 @@
+2002-06-14 Timo Schulz <[email protected]>
+
+ * skclist.c (is_insecure): Implemented.
+
2002-06-12 David Shaw <[email protected]>
* keyserver.c (keyserver_spawn): Properly handle PROGRAM responses
diff --git a/g10/skclist.c b/g10/skclist.c
index d895b3eff..1f7a3919a 100644
--- a/g10/skclist.c
+++ b/g10/skclist.c
@@ -55,11 +55,30 @@ release_sk_list( SK_LIST sk_list )
static int
is_insecure( PKT_secret_key *sk )
{
-
- return 0; /* FIXME!! */
+ u32 keyid[2];
+ KBNODE node = NULL, u;
+ int insecure = 0;
+
+ keyid_from_sk( sk, keyid );
+ node = get_pubkeyblock( keyid );
+ for ( u = node; u; u = u->next ) {
+ if ( u->pkt->pkttype == PKT_USER_ID ) {
+ PKT_user_id *id = u->pkt->pkt.user_id;
+ if ( id->attrib_data )
+ continue; /* skip attribute packets */
+ if ( strstr( id->name, "(insecure!)" )
+ || strstr( id->name, "not secure" )
+ || strstr( id->name, "do not use" ) ) {
+ insecure = 1;
+ break;
+ }
+ }
+ }
+ release_kbnode( node );
+
+ return insecure;
}
-
static int
key_present_in_sk_list(SK_LIST sk_list, PKT_secret_key *sk)
{