From f604b5db106046a95cb4b0ae1ace268d9f6472d8 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Mon, 3 May 1999 16:51:51 +0000 Subject: [PATCH] add flags to DB_seq, DB_firstkey, and DB_nextkey git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6089 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hdb/db.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/hdb/db.c b/lib/hdb/db.c index f495f0907..8a9bdb790 100644 --- a/lib/hdb/db.c +++ b/lib/hdb/db.c @@ -83,7 +83,8 @@ DB_unlock(krb5_context context, HDB *db) static krb5_error_code -DB_seq(krb5_context context, HDB *db, hdb_entry *entry, int flag) +DB_seq(krb5_context context, HDB *db, + unsigned flags, hdb_entry *entry, int flag) { DB *d = (DB*)db->db; DBT key, value; @@ -105,9 +106,9 @@ DB_seq(krb5_context context, HDB *db, hdb_entry *entry, int flag) data.data = value.data; data.length = value.size; if (hdb_value2entry(context, &data, entry)) - return DB_seq(context, db, entry, R_NEXT); - if (db->master_key_set) - hdb_unseal_keys (entry, db->master_key); + return DB_seq(context, db, flags, entry, R_NEXT); + if (db->master_key_set && (flags & HDB_F_DECRYPT)) + hdb_unseal_keys (db, entry); if (entry->principal == NULL) { entry->principal = malloc(sizeof(*entry->principal)); hdb_key2principal(context, &key_data, entry->principal); @@ -117,16 +118,16 @@ DB_seq(krb5_context context, HDB *db, hdb_entry *entry, int flag) static krb5_error_code -DB_firstkey(krb5_context context, HDB *db, hdb_entry *entry) +DB_firstkey(krb5_context context, HDB *db, unsigned flags, hdb_entry *entry) { - return DB_seq(context, db, entry, R_FIRST); + return DB_seq(context, db, flags, entry, R_FIRST); } static krb5_error_code -DB_nextkey(krb5_context context, HDB *db, hdb_entry *entry) +DB_nextkey(krb5_context context, HDB *db, unsigned flags, hdb_entry *entry) { - return DB_seq(context, db, entry, R_NEXT); + return DB_seq(context, db, flags, entry, R_NEXT); } static krb5_error_code