diff options
Diffstat (limited to 'crypto/heimdal/lib/hdb/convert_db.c')
-rw-r--r-- | crypto/heimdal/lib/hdb/convert_db.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/crypto/heimdal/lib/hdb/convert_db.c b/crypto/heimdal/lib/hdb/convert_db.c index b257809..1a7ebb4 100644 --- a/crypto/heimdal/lib/hdb/convert_db.c +++ b/crypto/heimdal/lib/hdb/convert_db.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1999 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -38,9 +38,10 @@ */ #include "hdb_locl.h" -#include "getarg.h" +#include <getarg.h> +#include <err.h> -RCSID("$Id: convert_db.c,v 1.8 1999/05/09 22:47:47 assar Exp $"); +RCSID("$Id: convert_db.c,v 1.11 2001/01/25 12:45:01 assar Exp $"); static krb5_error_code update_keytypes(krb5_context context, HDB *db, hdb_entry *entry, void *data) @@ -132,7 +133,6 @@ main(int argc, char **argv) krb5_error_code ret; krb5_context context; HDB *db, *new; - EncryptionKey key; int optind = 0; int master_key_set = 0; @@ -151,29 +151,23 @@ main(int argc, char **argv) ret = krb5_init_context(&context); if(ret != 0) - krb5_err(NULL, 1, ret, "krb5_init_context"); + errx(1, "krb5_init_context failed: %d", ret); ret = hdb_create(context, &db, old_database); if(ret != 0) krb5_err(context, 1, ret, "hdb_create"); - ret = hdb_read_master_key(context, mkeyfile, &key); - if(ret == 0) { - if(key.keytype == KEYTYPE_DES) - key.keytype = ETYPE_DES_CBC_MD5; - - ret = hdb_set_master_key(context, db, key); - if (ret) - krb5_err(context, 1, ret, "hdb_set_master_key"); - master_key_set = 1; - } + ret = hdb_set_master_keyfile(context, db, mkeyfile); + if (ret) + krb5_err(context, 1, ret, "hdb_set_master_keyfile"); + master_key_set = 1; ret = hdb_create(context, &new, new_database); if(ret != 0) krb5_err(context, 1, ret, "hdb_create"); if (master_key_set) { - ret = hdb_set_master_key(context, new, key); + ret = hdb_set_master_keyfile(context, new, mkeyfile); if (ret) - krb5_err(context, 1, ret, "hdb_set_master_key"); + krb5_err(context, 1, ret, "hdb_set_master_keyfile"); } ret = db->open(context, db, O_RDONLY, 0); if(ret == HDB_ERR_BADVERSION) { |