summaryrefslogtreecommitdiff
path: root/indra/newview/llsechandler_basic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsechandler_basic.cpp')
-rw-r--r--indra/newview/llsechandler_basic.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index da7eff7f54..1e50135e89 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,
@@ -901,7 +901,7 @@ void _validateCert(int validation_policy,
if (validation_policy & VALIDATION_POLICY_TIME)
{
- LLDate validation_date(time(NULL));
+ LLDate validation_date((double)time(NULL));
if(validation_params.has(CERT_VALIDATION_DATE))
{
validation_date = validation_params[CERT_VALIDATION_DATE];
@@ -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);
@@ -1111,7 +1111,7 @@ void LLBasicCertificateStore::validate(int validation_policy,
}
else
{
- validation_date = LLDate(time(NULL)); // current time
+ validation_date = LLDate((double)time(NULL)); // current time
}
if((validation_date < cache_entry->second.first) ||
@@ -1358,8 +1358,8 @@ void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_l
protected_data_stream.read((char *)buffer, BUFFER_READ_SIZE);
EVP_DecryptUpdate(ctx, decrypted_buffer, &decrypted_length,
- buffer, protected_data_stream.gcount());
- decrypted_data.append((const char *)decrypted_buffer, protected_data_stream.gcount());
+ buffer, (int)protected_data_stream.gcount());
+ decrypted_data.append((const char *)decrypted_buffer, (int)protected_data_stream.gcount());
}
// RC4 is a stream cipher, so we don't bother to EVP_DecryptFinal, as there is
@@ -1447,7 +1447,7 @@ void LLSecAPIBasicHandler::_writeProtectedData()
}
int encrypted_length;
EVP_EncryptUpdate(ctx, encrypted_buffer, &encrypted_length,
- buffer, formatted_data_istream.gcount());
+ buffer, (int)formatted_data_istream.gcount());
protected_data_stream.write((const char *)encrypted_buffer, encrypted_length);
}
@@ -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++;
}