if (keychain->name)
XFREE(MTYPE_KEYCHAIN, keychain->name);
- list_delete_and_null(&keychain->key);
+ list_delete(&keychain->key);
listnode_delete(keychain_list, keychain);
keychain_free(keychain);
}
-static struct key *key_lookup(const struct keychain *keychain, u_int32_t index)
+static struct key *key_lookup(const struct keychain *keychain, uint32_t index)
{
struct listnode *node;
struct key *key;
}
struct key *key_lookup_for_accept(const struct keychain *keychain,
- u_int32_t index)
+ uint32_t index)
{
struct listnode *node;
struct key *key;
if (key->accept.start == 0
|| (key->accept.start <= now
&& (key->accept.end >= now || key->accept.end == -1)))
- if (strncmp(key->string, auth_str, 16) == 0)
+ if (key->string && (strncmp(key->string, auth_str, 16) == 0))
return key;
}
return NULL;
return NULL;
}
-static struct key *key_get(const struct keychain *keychain, u_int32_t index)
+static struct key *key_get(const struct keychain *keychain, uint32_t index)
{
struct key *key;
int idx_number = 1;
VTY_DECLVAR_CONTEXT(keychain, keychain);
struct key *key;
- u_int32_t index;
+ uint32_t index;
index = strtoul(argv[idx_number]->arg, NULL, 10);
key = key_get(keychain, index);
int idx_number = 2;
VTY_DECLVAR_CONTEXT(keychain, keychain);
struct key *key;
- u_int32_t index;
+ uint32_t index;
index = strtoul(argv[idx_number]->arg, NULL, 10);
key = key_lookup(keychain, index);
const char *duration_str)
{
time_t time_start;
- u_int32_t duration;
+ uint32_t duration;
time_start = key_str2time(stime_str, sday_str, smonth_str, syear_str);
if (time_start < 0) {
&accept_lifetime_duration_day_month_cmd);
install_element(KEYCHAIN_KEY_NODE,
&accept_lifetime_duration_month_day_cmd);
- install_element(KEYCHAIN_KEY_NODE,
- &no_accept_lifetime_cmd);
+ install_element(KEYCHAIN_KEY_NODE, &no_accept_lifetime_cmd);
install_element(KEYCHAIN_KEY_NODE,
&send_lifetime_day_month_day_month_cmd);
&send_lifetime_duration_day_month_cmd);
install_element(KEYCHAIN_KEY_NODE,
&send_lifetime_duration_month_day_cmd);
- install_element(KEYCHAIN_KEY_NODE,
- &no_send_lifetime_cmd);
+ install_element(KEYCHAIN_KEY_NODE, &no_send_lifetime_cmd);
}