diff --git a/lib/ChangeLog b/lib/ChangeLog
index 292f850..4d64e21 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -3,6 +3,7 @@
 	* vty.c: As per Andrew's suggestions..
 	  (vty_serv_un) remove flags.
 	  (vtysh_accept) close socket if we cant set NONBLOCK. Add flags.
+	* keychain.c: Convert some more strtoul users to VTY_GET_INTEGER.
 
 2004-10-29 Paul Jakma <paul@dishone.st>
 
diff --git a/lib/keychain.c b/lib/keychain.c
index 1d38167..a3219ef 100644
--- a/lib/keychain.c
+++ b/lib/keychain.c
@@ -278,16 +278,10 @@
   struct keychain *keychain;
   struct key *key;
   u_int32_t index;
-  char *endptr = NULL;
 
   keychain = vty->index;
 
-  index = strtoul (argv[0], &endptr, 10);
-  if (index == ULONG_MAX || *endptr != '\0')
-    {
-      vty_out (vty, "Key identifier number error%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
+  VTY_GET_INTEGER ("key identifier", index, argv[0]);
   key = key_get (keychain, index);
   vty->index_sub = key;
   vty->node = KEYCHAIN_KEY_NODE;
@@ -305,17 +299,10 @@
   struct keychain *keychain;
   struct key *key;
   u_int32_t index;
-  char *endptr = NULL;
   
   keychain = vty->index;
 
-  index = strtoul (argv[0], &endptr, 10);
-  if (index == ULONG_MAX || *endptr != '\0')
-    {
-      vty_out (vty, "Key identifier number error%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
+  VTY_GET_INTEGER ("key identifier", index, argv[0]);
   key = key_lookup (keychain, index);
   if (! key)
     {
@@ -462,7 +449,7 @@
   tm.tm_year = year - 1900;
     
   time = mktime (&tm);
-
+  
   return time;
 }
 
@@ -475,7 +462,7 @@
 {
   time_t time_start;
   time_t time_end;
-    
+  
   time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str);
   if (time_start < 0)
     {
@@ -510,7 +497,6 @@
 {
   time_t time_start;
   u_int32_t duration;
-  char *endptr = NULL;
     
   time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str);
   if (time_start < 0)
@@ -520,12 +506,7 @@
     }
   krange->start = time_start;
 
-  duration = strtoul (duration_str, &endptr, 10);
-  if (duration == ULONG_MAX || *endptr != '\0')
-    {
-      vty_out (vty, "Malformed duration%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
+  VTY_GET_INTEGER ("duration", duration, duration_str);
   krange->duration = 1;
   krange->end = time_start + duration;
 
