Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
cae4e785
Commit
cae4e785
authored
15 years ago
by
Roxie Linden
Browse files
Options
Downloads
Patches
Plain Diff
Allow update of the default CAs on install
parent
75755a67
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llsechandler_basic.cpp
+23
-22
23 additions, 22 deletions
indra/newview/llsechandler_basic.cpp
with
23 additions
and
22 deletions
indra/newview/llsechandler_basic.cpp
+
23
−
22
View file @
cae4e785
...
@@ -585,6 +585,11 @@ LLBasicCertificateStore::LLBasicCertificateStore(const std::string& filename)
...
@@ -585,6 +585,11 @@ LLBasicCertificateStore::LLBasicCertificateStore(const std::string& filename)
void
LLBasicCertificateStore
::
load_from_file
(
const
std
::
string
&
filename
)
void
LLBasicCertificateStore
::
load_from_file
(
const
std
::
string
&
filename
)
{
{
// scan the PEM file extracting each certificate
// scan the PEM file extracting each certificate
if
(
!
LLFile
::
isfile
(
filename
))
{
return
;
}
BIO
*
file_bio
=
BIO_new
(
BIO_s_file
());
BIO
*
file_bio
=
BIO_new
(
BIO_s_file
());
if
(
file_bio
)
if
(
file_bio
)
{
{
...
@@ -1148,30 +1153,26 @@ void LLSecAPIBasicHandler::init()
...
@@ -1148,30 +1153,26 @@ void LLSecAPIBasicHandler::init()
"bin_conf.dat"
);
"bin_conf.dat"
);
std
::
string
store_file
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
std
::
string
store_file
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
"CA.pem"
);
"CA.pem"
);
// copy the CA file to a user writable location so we can manipulate it.
// for this provider, by using a user writable file, there is a risk that
// an attacking program can modify the file, but OS dependent providers
// will reduce that risk.
// by using a user file, modifications will be limited to one user if
// we read-only the main file
if
(
!
LLFile
::
isfile
(
store_file
))
{
LL_INFOS
(
"SECAPI"
)
<<
"Loading certificate store from "
<<
store_file
<<
LL_ENDL
;
mStore
=
new
LLBasicCertificateStore
(
store_file
);
// grab the application CA.pem file that contains the well-known certs shipped
// with the product
std
::
string
ca_file_path
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_APP_SETTINGS
,
"CA.pem"
);
std
::
string
ca_file_path
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_APP_SETTINGS
,
"CA.pem"
);
lli
fstream
ca_file
(
ca_file_path
.
c_str
(),
llifstream
::
binary
|
llifstream
::
in
)
;
lli
nfos
<<
"app path "
<<
ca_file_path
<<
llendl
;
llofstream
copied_store_file
(
store_file
.
c_str
(),
llofstream
::
binary
|
llofstream
::
out
);
LLBasicCertificateStore
app_ca_store
=
LLBasicCertificateStore
(
ca_file_path
);
while
(
!
ca_file
.
fail
())
// push the applicate CA files into the store, therefore adding any new CA certs that
// updated
for
(
LLCertificateVector
::
iterator
i
=
app_ca_store
.
begin
();
i
!=
app_ca_store
.
end
();
i
++
)
{
{
char
buffer
[
BUFFER_READ_SIZE
];
mStore
->
add
(
*
i
);
ca_file
.
read
(
buffer
,
sizeof
(
buffer
));
copied_store_file
.
write
(
buffer
,
ca_file
.
gcount
());
}
ca_file
.
close
();
copied_store_file
.
close
();
}
}
LL_INFOS
(
"SECAPI"
)
<<
"Loading certificate store from "
<<
store_file
<<
LL_ENDL
;
mStore
=
new
LLBasicCertificateStore
(
store_file
);
}
}
_readProtectedData
();
// initialize mProtectedDataMap
_readProtectedData
();
// initialize mProtectedDataMap
// may throw LLProtectedDataException if saved datamap is not decryptable
// may throw LLProtectedDataException if saved datamap is not decryptable
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment