suffix length config
Change-Id: Ic1fd46a7d9b21a342cd9bf693169dc5df34fc651
diff --git a/src/ca-config.cpp b/src/ca-config.cpp
index c8bc298..c9721fb 100644
--- a/src/ca-config.cpp
+++ b/src/ca-config.cpp
@@ -59,7 +59,10 @@
// CA max validity period
m_maxValidityPeriod = time::seconds(configJson.get(CONFIG_MAX_VALIDITY_PERIOD, 3600));
// CA max suffix length
- m_maxSuffixLength = configJson.get(CONFIG_MAX_SUFFIX_LENGTH, 1);
+ m_maxSuffixLength = configJson.get<size_t>(CONFIG_MAX_SUFFIX_LENGTH, 1);
+ if (m_maxSuffixLength == 0) {
+ m_maxSuffixLength = 1;
+ }
// probe
m_probeParameterKeys.clear();
auto probeParameters = configJson.get_child_optional(CONFIG_PROBE_PARAMETERS);