From: Ezra Peisach Date: Tue, 4 Jul 2000 12:16:48 +0000 (+0000) Subject: * encrypt_key.c, kdb_cpw.c, kdb_xdr.c: Add parenthesis about X-Git-Tag: krb5-1.3-alpha1~2006 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7b6d74dc3171498d9d95cf373540e56589d43ec7;p=krb5.git * encrypt_key.c, kdb_cpw.c, kdb_xdr.c: Add parenthesis about assignment in conditional and remove unused variables. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12531 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index 28f688b5b..87f78da09 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,8 @@ +2000-07-04 Ezra Peisach + + * encrypt_key.c, kdb_cpw.c, kdb_xdr.c: Add parenthesis about + assignment in conditional and remove unused variables. + 2000-06-30 Tom Yu * Makefile.in (SHLIB_EXPDEPS): Add libdb, since we can build this diff --git a/src/lib/kdb/encrypt_key.c b/src/lib/kdb/encrypt_key.c index 1448ebd6d..aa259f900 100644 --- a/src/lib/kdb/encrypt_key.c +++ b/src/lib/kdb/encrypt_key.c @@ -71,7 +71,6 @@ krb5_dbekd_encrypt_key_data(context, mkey, dbkey, keysalt, keyver, key_data) krb5_key_data * key_data; { krb5_error_code retval; - krb5_keyblock tmp; krb5_octet * ptr; size_t len; int i; @@ -120,7 +119,7 @@ krb5_dbekd_encrypt_key_data(context, mkey, dbkey, keysalt, keyver, key_data) if (keysalt->type > 0) { key_data->key_data_ver++; key_data->key_data_type[1] = keysalt->type; - if (key_data->key_data_length[1] = keysalt->data.length) { + if ((key_data->key_data_length[1] = keysalt->data.length) != 0) { key_data->key_data_contents[1] = (krb5_octet *)malloc(keysalt->data.length); if (key_data->key_data_contents[1] == NULL) { diff --git a/src/lib/kdb/kdb_cpw.c b/src/lib/kdb/kdb_cpw.c index d5f0f3676..d39c1cafd 100644 --- a/src/lib/kdb/kdb_cpw.c +++ b/src/lib/kdb/kdb_cpw.c @@ -102,7 +102,6 @@ add_key_rnd(context, master_key, ks_tuple, ks_tuple_count, db_entry, kvno) krb5_principal krbtgt_princ; krb5_keyblock key; krb5_db_entry krbtgt_entry; - krb5_key_data * krbtgt_kdata; krb5_boolean more; int max_kvno, one, i, j; krb5_error_code retval; @@ -162,7 +161,7 @@ add_key_rnd(context, master_key, ks_tuple, ks_tuple_count, db_entry, kvno) if (similar) continue; - if (retval = krb5_dbe_create_key_data(context, db_entry)) + if ((retval = krb5_dbe_create_key_data(context, db_entry))) goto add_key_rnd_err; /* there used to be code here to extract the old key, and derive @@ -276,8 +275,8 @@ krb5_dbe_ark(context, master_key, ks_tuple, ks_tuple_count, db_entry) /* increment the kvno */ kvno++; - if (retval = add_key_rnd(context, master_key, ks_tuple, - ks_tuple_count, db_entry, kvno)) { + if ((retval = add_key_rnd(context, master_key, ks_tuple, + ks_tuple_count, db_entry, kvno))) { cleanup_key_data(context, db_entry->n_key_data, db_entry->key_data); db_entry->n_key_data = key_data_count; db_entry->key_data = key_data; @@ -285,7 +284,7 @@ krb5_dbe_ark(context, master_key, ks_tuple, ks_tuple_count, db_entry) /* Copy keys with key_data_kvno == kvno - 1 ( = old kvno ) */ for (i = 0; i < key_data_count; i++) { if (key_data[i].key_data_kvno == (kvno - 1)) { - if (retval = krb5_dbe_create_key_data(context, db_entry)) { + if ((retval = krb5_dbe_create_key_data(context, db_entry))) { cleanup_key_data(context, db_entry->n_key_data, db_entry->key_data); break; @@ -319,7 +318,6 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd, krb5_keysalt key_salt; krb5_keyblock key; krb5_data pwd; - krb5_boolean found; int i, j; retval = 0; @@ -349,15 +347,15 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd, if (j < i) continue; - if (retval = krb5_dbe_create_key_data(context, db_entry)) + if ((retval = krb5_dbe_create_key_data(context, db_entry))) return(retval); /* Convert password string to key using appropriate salt */ switch (key_salt.type = ks_tuple[i].ks_salttype) { case KRB5_KDB_SALTTYPE_ONLYREALM: { krb5_data * saltdata; - if (retval = krb5_copy_data(context, krb5_princ_realm(context, - db_entry->princ), &saltdata)) + if ((retval = krb5_copy_data(context, krb5_princ_realm(context, + db_entry->princ), &saltdata))) return(retval); key_salt.data = *saltdata; @@ -365,13 +363,13 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd, } break; case KRB5_KDB_SALTTYPE_NOREALM: - if (retval=krb5_principal2salt_norealm(context, db_entry->princ, - &key_salt.data)) + if ((retval=krb5_principal2salt_norealm(context, db_entry->princ, + &key_salt.data))) return(retval); break; case KRB5_KDB_SALTTYPE_NORMAL: - if (retval = krb5_principal2salt(context, db_entry->princ, - &key_salt.data)) + if ((retval = krb5_principal2salt(context, db_entry->princ, + &key_salt.data))) return(retval); break; case KRB5_KDB_SALTTYPE_V4: @@ -421,9 +419,9 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd, key_salt.data.length = krb5_princ_realm(context, db_entry->princ)->length; - if (retval = krb5_dbekd_encrypt_key_data(context, master_key, &key, + if ((retval = krb5_dbekd_encrypt_key_data(context, master_key, &key, (const krb5_keysalt *)&key_salt, - kvno, &db_entry->key_data[db_entry->n_key_data-1])) { + kvno, &db_entry->key_data[db_entry->n_key_data-1]))) { if (key_salt.data.data) free(key_salt.data.data); krb5_xfree(key.contents); @@ -530,8 +528,8 @@ krb5_dbe_apw(context, master_key, ks_tuple, ks_tuple_count, passwd, db_entry) /* increment the kvno */ new_kvno = old_kvno+1; - if (retval = add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, - passwd, db_entry, new_kvno)) { + if ((retval = add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, + passwd, db_entry, new_kvno))) { cleanup_key_data(context, db_entry->n_key_data, db_entry->key_data); db_entry->n_key_data = key_data_count; db_entry->key_data = key_data; @@ -539,7 +537,7 @@ krb5_dbe_apw(context, master_key, ks_tuple, ks_tuple_count, passwd, db_entry) /* Copy keys with key_data_kvno == old_kvno */ for (i = 0; i < key_data_count; i++) { if (key_data[i].key_data_kvno == old_kvno) { - if (retval = krb5_dbe_create_key_data(context, db_entry)) { + if ((retval = krb5_dbe_create_key_data(context, db_entry))) { cleanup_key_data(context, db_entry->n_key_data, db_entry->key_data); break; diff --git a/src/lib/kdb/kdb_xdr.c b/src/lib/kdb/kdb_xdr.c index 5d1911e20..4a1fb65cc 100644 --- a/src/lib/kdb/kdb_xdr.c +++ b/src/lib/kdb/kdb_xdr.c @@ -151,7 +151,7 @@ krb5_dbe_lookup_last_pwd_change(context, entry, stamp) tl_data.tl_data_type = KRB5_TL_LAST_PWD_CHANGE; - if (code = krb5_dbe_lookup_tl_data(context, entry, &tl_data)) + if ((code = krb5_dbe_lookup_tl_data(context, entry, &tl_data))) return(code); if (tl_data.tl_data_length != 4) { @@ -225,7 +225,7 @@ krb5_dbe_lookup_mod_princ_data(context, entry, mod_time, mod_princ) tl_data.tl_data_type = KRB5_TL_MOD_PRINC; - if (code = krb5_dbe_lookup_tl_data(context, entry, &tl_data)) + if ((code = krb5_dbe_lookup_tl_data(context, entry, &tl_data))) return(code); if ((tl_data.tl_data_length < 5) ||