Renamed from `rsa-decrypt', since the name was no longer appropriate.
[u/mdw/catacomb] / key-data.c
index 5da8b38..294fe34 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: key-data.c,v 1.2 2000/02/12 18:21:02 mdw Exp $
+ * $Id: key-data.c,v 1.3 2000/06/17 11:26:03 mdw Exp $
  *
  * Encoding and decoding of key data
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: key-data.c,v $
+ * Revision 1.3  2000/06/17 11:26:03  mdw
+ * key_structfind: track minor data structure change, and cope if the
+ * subkey isn't available.
+ *
  * Revision 1.2  2000/02/12 18:21:02  mdw
  * Overhaul of key management (again).
  *
@@ -138,8 +142,11 @@ void key_structure(key_data *k)
 key_data *key_structfind(key_data *k, const char *tag)
 {
   key_struct *ks;
-  assert(((void)"Key is not structured", k->e == KENC_STRUCT));
+  assert(((void)"Key is not structured",
+         (k->e & KF_ENCMASK) == KENC_STRUCT));
   ks = sym_find(&k->u.s, tag, -1, 0, 0);
+  if (!ks)
+    return (0);
   return (&ks->k);
 }