summaryrefslogtreecommitdiff
path: root/indra/newview/llsechandler_basic.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-08-28 20:47:43 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-08-28 20:47:43 -0400
commitcde1174345224d33d6b45b1e3243fa39043223e5 (patch)
tree6c8db6e0499622d8c7206a11c997eb173ebd478f /indra/newview/llsechandler_basic.cpp
parent6f454ad8366ed33bbe199c3fc3ed69e6d3448cec (diff)
parent35efadf78315f9b351415930dca4fae251ef4dd0 (diff)
Merge branch 'main' into release/luau-scripting.
Diffstat (limited to 'indra/newview/llsechandler_basic.cpp')
-rw-r--r--indra/newview/llsechandler_basic.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index da7eff7f54..2d8a5eaf13 100644
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -75,7 +75,7 @@ LLBasicCertificate::LLBasicCertificate(const std::string& pem_cert,
{
// BIO_new_mem_buf returns a read only bio, but takes a void* which isn't const
// so we need to cast it.
- BIO * pem_bio = BIO_new_mem_buf((void*)pem_cert.c_str(), pem_cert.length());
+ BIO * pem_bio = BIO_new_mem_buf((void*)pem_cert.c_str(), static_cast<int>(pem_cert.length()));
if(pem_bio == NULL)
{
LL_WARNS("SECAPI") << "Could not allocate an openssl memory BIO." << LL_ENDL;
@@ -747,7 +747,7 @@ bool _cert_subdomain_wildcard_match(const std::string& subdomain,
{
// split wildcard into the portion before the *, and the portion after
- int wildcard_pos = wildcard.find_first_of('*');
+ auto wildcard_pos = wildcard.find_first_of('*');
// check the case where there is no wildcard.
if(wildcard_pos == wildcard.npos)
{
@@ -759,7 +759,7 @@ bool _cert_subdomain_wildcard_match(const std::string& subdomain,
if(subdomain.substr(0, wildcard_pos) != wildcard.substr(0, wildcard_pos))
{
// the first portions of the strings didn't match
- return FALSE;
+ return false;
}
// as the portion of the wildcard string before the * matched, we need to check the
@@ -768,7 +768,7 @@ bool _cert_subdomain_wildcard_match(const std::string& subdomain,
if(new_wildcard_string.empty())
{
// we had nothing after the *, so it's an automatic match
- return TRUE;
+ return true;
}
// grab the portion of the remaining wildcard string before the next '*'. We need to find this
@@ -779,20 +779,20 @@ bool _cert_subdomain_wildcard_match(const std::string& subdomain,
std::string new_subdomain = subdomain.substr(wildcard_pos, subdomain.npos);
// iterate through the current subdomain, finding instances of the match string.
- int sub_pos = new_subdomain.find_first_of(new_wildcard_match_string);
+ auto sub_pos = new_subdomain.find_first_of(new_wildcard_match_string);
while(sub_pos != std::string::npos)
{
new_subdomain = new_subdomain.substr(sub_pos, std::string::npos);
if(_cert_subdomain_wildcard_match(new_subdomain, new_wildcard_string))
{
- return TRUE;
+ return true;
}
sub_pos = new_subdomain.find_first_of(new_wildcard_match_string, 1);
}
// didn't find any instances of the match string that worked in the subdomain, so fail.
- return FALSE;
+ return false;
}
@@ -811,8 +811,8 @@ bool _cert_hostname_wildcard_match(const std::string& hostname, const std::strin
std::string new_cn = common_name;
// find the last '.' in the hostname and the match name.
- int subdomain_pos = new_hostname.find_last_of('.');
- int subcn_pos = new_cn.find_last_of('.');
+ auto subdomain_pos = new_hostname.find_last_of('.');
+ auto subcn_pos = new_cn.find_last_of('.');
// if the last char is a '.', strip it
if(subdomain_pos == (new_hostname.length()-1))
@@ -837,7 +837,7 @@ bool _cert_hostname_wildcard_match(const std::string& hostname, const std::strin
if(!_cert_subdomain_wildcard_match(new_hostname.substr(subdomain_pos+1, std::string::npos),
cn_part))
{
- return FALSE;
+ return false;
}
new_hostname = new_hostname.substr(0, subdomain_pos);
new_cn = new_cn.substr(0, subcn_pos);
@@ -849,7 +849,7 @@ bool _cert_hostname_wildcard_match(const std::string& hostname, const std::strin
if(new_cn == "*")
{
// if it's just a '*' we support all child domains as well, so '*.
- return TRUE;
+ return true;
}
return _cert_subdomain_wildcard_match(new_hostname, new_cn);
@@ -865,10 +865,10 @@ bool _LLSDArrayIncludesValue(const LLSD& llsd_set, LLSD llsd_value)
{
if(valueCompareLLSD((*set_value), llsd_value))
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void _validateCert(int validation_policy,
@@ -975,7 +975,7 @@ void _validateCert(int validation_policy,
bool _verify_signature(LLPointer<LLCertificate> parent,
LLPointer<LLCertificate> child)
{
- bool verify_result = FALSE;
+ bool verify_result = false;
LLSD cert1, cert2;
parent->getLLSD(cert1);
child->getLLSD(cert2);
@@ -1860,7 +1860,7 @@ std::string LLSecAPIBasicHandler::_legacyLoadPassword()
unsigned char unique_id[MAC_ADDRESS_BYTES];
LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
LLXORCipher cipher(unique_id, sizeof(unique_id));
- cipher.decrypt(&buffer[0], buffer.size());
+ cipher.decrypt(&buffer[0], static_cast<U32>(buffer.size()));
return std::string((const char*)&buffer[0], buffer.size());
}
@@ -1913,7 +1913,7 @@ bool valueCompareLLSD(const LLSD& lhs, const LLSD& rhs)
{
if (lhs.type() != rhs.type())
{
- return FALSE;
+ return false;
}
if (lhs.isMap())
{
@@ -1925,7 +1925,7 @@ bool valueCompareLLSD(const LLSD& lhs, const LLSD& rhs)
{
if (!rhs.has(litt->first))
{
- return FALSE;
+ return false;
}
}
@@ -1937,14 +1937,14 @@ bool valueCompareLLSD(const LLSD& lhs, const LLSD& rhs)
{
if (!lhs.has(ritt->first))
{
- return FALSE;
+ return false;
}
if (!valueCompareLLSD(lhs[ritt->first], ritt->second))
{
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
else if (lhs.isArray())
{
@@ -1956,7 +1956,7 @@ bool valueCompareLLSD(const LLSD& lhs, const LLSD& rhs)
{
if (!valueCompareLLSD(*ritt, *litt))
{
- return FALSE;
+ return false;
}
ritt++;
}