The unified diff between revisions [b3f30c54..] and [13704fef..] is displayed below. It can also be downloaded as a raw diff.

#
#
# patch "include/parsing.h"
#  from [495ba5383d508f77387155181abc7c82548238d8]
#    to [6e44cb37e371bc52fb831a5cbc9ec6ba8a1889e1]
#
# patch "src/config.cpp"
#  from [ff5bbdf754d3f6d5ab8b0b6ea331153b6a9f30f0]
#    to [5b03caccc6f428dee4805f937c74715d5144f83f]
#
# patch "src/parsing.cpp"
#  from [df0419ff36e21c79ca86fb06d7aadbde8c92b733]
#    to [07004ffd721f7f70ccb2f50f0a1f4a7e98c028cb]
#
============================================================
--- include/parsing.h	495ba5383d508f77387155181abc7c82548238d8
+++ include/parsing.h	6e44cb37e371bc52fb831a5cbc9ec6ba8a1889e1
@@ -26,6 +26,8 @@ BOTAN_DLL u32bit to_u32bit(const std::st
 BOTAN_DLL std::string to_string(u64bit, u32bit = 0);
 BOTAN_DLL u32bit to_u32bit(const std::string&);

+BOTAN_DLL u32bit timespec_to_u32bit(const std::string& timespec);
+
 /*************************************************
 * String/Network Address Conversions             *
 *************************************************/
============================================================
--- src/config.cpp	ff5bbdf754d3f6d5ab8b0b6ea331153b6a9f30f0
+++ src/config.cpp	5b03caccc6f428dee4805f937c74715d5144f83f
@@ -126,33 +126,7 @@ u32bit Config::option_as_time(const std:
 *************************************************/
 u32bit Config::option_as_time(const std::string& key) const
    {
-   const std::string timespec = option(key);
-   if(timespec == "")
-      return 0;
-
-   const char suffix = timespec[timespec.size()-1];
-   std::string value = timespec.substr(0, timespec.size()-1);
-
-   u32bit scale = 1;
-
-   if(Charset::is_digit(suffix))
-      value += suffix;
-   else if(suffix == 's')
-      scale = 1;
-   else if(suffix == 'm')
-      scale = 60;
-   else if(suffix == 'h')
-      scale = 60 * 60;
-   else if(suffix == 'd')
-      scale = 24 * 60 * 60;
-   else if(suffix == 'y')
-      scale = 365 * 24 * 60 * 60;
-   else
-      throw Decoding_Error(
-         "Config::option_as_time: Unknown time value " + value
-         );
-
-   return scale * to_u32bit(value);
+   return timespec_to_u32bit(option(key));
    }

 }
============================================================
--- src/parsing.cpp	df0419ff36e21c79ca86fb06d7aadbde8c92b733
+++ src/parsing.cpp	07004ffd721f7f70ccb2f50f0a1f4a7e98c028cb
@@ -55,6 +55,37 @@ std::string to_string(u64bit n, u32bit m
    }

 /*************************************************
+* Convert a string into a time duration          *
+*************************************************/
+u32bit timespec_to_u32bit(const std::string& timespec)
+   {
+   if(timespec == "")
+      return 0;
+
+   const char suffix = timespec[timespec.size()-1];
+   std::string value = timespec.substr(0, timespec.size()-1);
+
+   u32bit scale = 1;
+
+   if(Charset::is_digit(suffix))
+      value += suffix;
+   else if(suffix == 's')
+      scale = 1;
+   else if(suffix == 'm')
+      scale = 60;
+   else if(suffix == 'h')
+      scale = 60 * 60;
+   else if(suffix == 'd')
+      scale = 24 * 60 * 60;
+   else if(suffix == 'y')
+      scale = 365 * 24 * 60 * 60;
+   else
+      throw Decoding_Error("timespec_to_u32bit: Bad input " + timespec);
+
+   return scale * to_u32bit(value);
+   }
+
+/*************************************************
 * Parse a SCAN-style algorithm name              *
 *************************************************/
 std::vector<std::string> parse_algorithm_name(const std::string& namex)