aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/x509
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-12-06 11:08:45 -0500
committerJack Lloyd <[email protected]>2019-12-06 11:11:56 -0500
commit96a59276189e058059ddc63d0f3c598f8d8d68b5 (patch)
tree068f123ebcfec21dcafd8bd42bd3c77f7511b0e7 /src/lib/x509
parent986fca5c3b2946953e3e370fb637099591b86128 (diff)
Resolve various integer conversion warnings from MSVC
Diffstat (limited to 'src/lib/x509')
-rw-r--r--src/lib/x509/certstor_sql/certstor_sql.cpp2
-rw-r--r--src/lib/x509/key_constraint.cpp2
-rw-r--r--src/lib/x509/name_constraint.cpp8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/x509/certstor_sql/certstor_sql.cpp b/src/lib/x509/certstor_sql/certstor_sql.cpp
index 1ffa2e8ca..e8a511645 100644
--- a/src/lib/x509/certstor_sql/certstor_sql.cpp
+++ b/src/lib/x509/certstor_sql/certstor_sql.cpp
@@ -282,7 +282,7 @@ void Certificate_Store_In_SQL::revoke_cert(const X509_Certificate& cert, CRL_Cod
}
else
{
- stmt1->bind(3,-1);
+ stmt1->bind(3, static_cast<size_t>(-1));
}
stmt1->spin();
diff --git a/src/lib/x509/key_constraint.cpp b/src/lib/x509/key_constraint.cpp
index 05bd8edb0..f7f9523bf 100644
--- a/src/lib/x509/key_constraint.cpp
+++ b/src/lib/x509/key_constraint.cpp
@@ -97,7 +97,7 @@ void verify_cert_constraints_valid_for_key_type(const Public_Key& pub_key,
permitted |= DIGITAL_SIGNATURE | NON_REPUDIATION | KEY_CERT_SIGN | CRL_SIGN;
}
- if((constraints & permitted) != constraints)
+ if(Key_Constraints(constraints & permitted) != constraints)
{
throw Invalid_Argument("Invalid " + name + " constraints " + key_constraints_to_string(constraints));
}
diff --git a/src/lib/x509/name_constraint.cpp b/src/lib/x509/name_constraint.cpp
index b64e04d29..ab654ae5e 100644
--- a/src/lib/x509/name_constraint.cpp
+++ b/src/lib/x509/name_constraint.cpp
@@ -227,14 +227,14 @@ std::ostream& operator<<(std::ostream& os, const GeneralName& gn)
GeneralSubtree::GeneralSubtree(const std::string& str) : GeneralSubtree()
{
size_t p0, p1;
- size_t min = std::stoull(str, &p0, 10);
- size_t max = std::stoull(str.substr(p0 + 1), &p1, 10);
+ const auto min = std::stoull(str, &p0, 10);
+ const auto max = std::stoull(str.substr(p0 + 1), &p1, 10);
GeneralName gn(str.substr(p0 + p1 + 2));
if(p0 > 0 && p1 > 0)
{
- m_minimum = min;
- m_maximum = max;
+ m_minimum = static_cast<size_t>(min);
+ m_maximum = static_cast<size_t>(max);
m_base = gn;
}
else