* keygen.c (write_keyblock): Don't try and build deleted kbnodes since
authorDavid Shaw <dshaw@jabberwocky.com>
Thu, 4 Aug 2005 21:41:11 +0000 (21:41 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Thu, 4 Aug 2005 21:41:11 +0000 (21:41 +0000)
we start our tree with one.

g10/ChangeLog
g10/keygen.c

index 7b0d67c..1204e72 100644 (file)
@@ -1,7 +1,7 @@
 2005-08-04  David Shaw  <dshaw@jabberwocky.com>
 
-       * keygen.c (start_tree): Need to use an actual packet type (which
-       we can then delete) to start the tree.
+       * keygen.c (write_keyblock): Don't try and build deleted kbnodes
+       since we start our tree with one.
 
 2005-08-04  Werner Koch  <wk@g10code.com>
 
index a657c13..44a9204 100644 (file)
@@ -3222,15 +3222,21 @@ generate_card_subkeypair (KBNODE pub_keyblock, KBNODE sec_keyblock,
 static int
 write_keyblock( IOBUF out, KBNODE node )
 {
-    for( ; node ; node = node->next ) {
-       int rc = build_packet( out, node->pkt );
-       if( rc ) {
-           log_error("build_packet(%d) failed: %s\n",
+  for( ; node ; node = node->next )
+    {
+      if(!is_deleted_kbnode(node))
+       {
+         int rc = build_packet( out, node->pkt );
+         if( rc )
+           {
+             log_error("build_packet(%d) failed: %s\n",
                        node->pkt->pkttype, g10_errstr(rc) );
-           return G10ERR_WRITE_FILE;
+             return G10ERR_WRITE_FILE;
+           }
        }
     }
-    return 0;
+
+  return 0;
 }