+2000-10-12 Ezra Peisach <epeisach@mit.edu>
+
+ * lock-test.c (main): Cleanup assignments in conditionals. If
+ USE_KADM5_API_VERSION is 1, set to 2. This program uses the V2 api
+ (kadm5_get_config_params).
+
+ * setkey-test.c: Declare main() as int. Enclose initialization of
+ elements of arrays in '{', '}'. Use krb5_enctype type instead of
+ unsigned int. Break out assignments in conditionals.
+
+ * destroy-test.c, handle-test.c, init-test.c, iter-test.c,
+ randkey-test.c: Declare main() as int.
+
2000-06-28 Ezra Peisach <epeisach@mit.edu>
* iter-test.c (main): Code was using ovsec_kadm_ret_t in place of
+#if USE_KADM5_API_VERSION == 1
+#undef USE_KADM5_API_VERSION
+#define USE_KADM5_API_VERSION 2
+#endif
+
#include <stdio.h>
#include <krb5.h>
#include <kadm5/admin.h>
char *whoami;
-void usage()
+static void usage()
{
fprintf(stderr,
"Usage: %s {shared|exclusive|permanent|release|"
exit(1);
}
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
osa_adb_ret_t ret;
osa_adb_policy_t policy_db;
initialize_ovku_error_table();
params.mask = 0;
- if (ret = kadm5_get_config_params(context, NULL, NULL, ¶ms,
- ¶ms)) {
+ ret = kadm5_get_config_params(context, NULL, NULL, ¶ms,
+ ¶ms);
+ if (ret) {
com_err(whoami, ret, "while retrieving configuration parameters");
exit(1);
}
#endif /* no random */
krb5_keyblock test1[] = {
- 0, ENCTYPE_DES_CBC_CRC, 0, 0,
- -1,
+ {0, ENCTYPE_DES_CBC_CRC, 0, 0},
+ {-1},
};
krb5_keyblock test2[] = {
- 0, ENCTYPE_DES_CBC_RAW, 0, 0,
- -1,
+ {0, ENCTYPE_DES_CBC_RAW, 0, 0},
+ {-1},
};
krb5_keyblock test3[] = {
- 0, ENCTYPE_DES_CBC_MD5, 0, 0,
- -1,
+ {0, ENCTYPE_DES_CBC_MD5, 0, 0},
+ {-1},
};
krb5_keyblock *tests[] = {
test1, test2, test3, NULL
};
+#if 0
int keyblocks_equal(krb5_keyblock *kb1, krb5_keyblock *kb2)
{
return (kb1->enctype == kb2->enctype &&
kb1->length == kb2->length &&
memcmp(kb1->contents, kb2->contents, kb1->length) == 0);
}
+#endif
krb5_data tgtname = {
0,
KRB5_TGS_NAME
};
-unsigned int ktypes[] = { 0, 0 };
+krb5_enctype ktypes[] = { 0, 0 };
extern krb5_kt_ops krb5_ktf_writable_ops;
+int
main(int argc, char **argv)
{
krb5_context context;
}
/* register the WRFILE keytab type */
- if (ret = krb5_kt_register(context, &krb5_ktf_writable_ops)) {
+ ret = krb5_kt_register(context, &krb5_ktf_writable_ops);
+ if (ret) {
com_err(whoami, ret,
"while registering writable key table functions");
exit(1);
pw[i] = (RAND() % 26) + '0'; /* XXX */
krb5_use_enctype(context, &eblock, testp[encnum].enctype);
- if (ret = krb5_string_to_key(context, &eblock, &testp[encnum],
- &pwdata, NULL)) {
+ ret = krb5_string_to_key(context, &eblock, &testp[encnum],
+ &pwdata, NULL);
+ if (ret) {
com_err(whoami, ret, "while converting string to key");
exit(1);
}