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
8f2df75f
Commit
8f2df75f
authored
15 years ago
by
Karen Lahey
Browse files
Options
Downloads
Patches
Plain Diff
Fix build.
parent
b90c7d64
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llsechandler_basic.cpp
+25
-29
25 additions, 29 deletions
indra/newview/llsechandler_basic.cpp
indra/newview/tests/llsechandler_basic_test.cpp
+5
-5
5 additions, 5 deletions
indra/newview/tests/llsechandler_basic_test.cpp
with
30 additions
and
34 deletions
indra/newview/llsechandler_basic.cpp
+
25
−
29
View file @
8f2df75f
...
...
@@ -1038,46 +1038,42 @@ LLSecAPIBasicHandler::LLSecAPIBasicHandler()
void
LLSecAPIBasicHandler
::
init
()
{
mProtectedDataMap
=
LLSD
::
emptyMap
();
if
(
mProtectedDataFilename
.
length
()
==
0
)
{
mProtectedDataFilename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
"bin_conf.dat"
);
}
if
(
mLegacyPasswordPath
.
length
()
==
0
)
{
mLegacyPasswordPath
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
"password.dat"
);
}
mProtectedDataMap
=
LLSD
::
emptyMap
();
mProtectedDataFilename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
mProtectedDataFilename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
"bin_conf.dat"
);
std
::
string
store_file
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
"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
))
{
std
::
string
store_file
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
"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
))
{
std
::
string
ca_file_path
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_APP_SETTINGS
,
"CA.pem"
);
llifstream
ca_file
(
ca_file_path
.
c_str
(),
llifstream
::
binary
|
llifstream
::
in
);
llofstream
copied_store_file
(
store_file
.
c_str
(),
llofstream
::
binary
|
llofstream
::
out
);
std
::
string
ca_file_path
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_APP_SETTINGS
,
"CA.pem"
);
llifstream
ca_file
(
ca_file_path
.
c_str
(),
llifstream
::
binary
|
llifstream
::
in
);
llofstream
copied_store_file
(
store_file
.
c_str
(),
llofstream
::
binary
|
llofstream
::
out
);
while
(
!
ca_file
.
fail
())
{
char
buffer
[
BUFFER_READ_SIZE
];
ca_file
.
read
(
buffer
,
sizeof
(
buffer
));
copied_store_file
.
write
(
buffer
,
ca_file
.
gcount
());
while
(
!
ca_file
.
fail
())
{
char
buffer
[
BUFFER_READ_SIZE
];
ca_file
.
read
(
buffer
,
sizeof
(
buffer
));
copied_store_file
.
write
(
buffer
,
ca_file
.
gcount
());
}
ca_file
.
close
();
copied_store_file
.
close
();
}
ca_file
.
close
()
;
copied_
store_file
.
close
(
);
LL_INFOS
(
"SECAPI"
)
<<
"Loading certificate store from "
<<
store_file
<<
LL_ENDL
;
mStore
=
new
LLBasicCertificateStore
(
store_file
);
}
LL_INFOS
(
"SECAPI"
)
<<
"Loading certificate store from "
<<
store_file
<<
LL_ENDL
;
mStore
=
new
LLBasicCertificateStore
(
store_file
);
_readProtectedData
();
// initialize mProtectedDataMap
// may throw LLProtectedDataException if saved datamap is not decryptable
}
...
...
This diff is collapsed.
Click to expand it.
indra/newview/tests/llsechandler_basic_test.cpp
+
5
−
5
View file @
8f2df75f
...
...
@@ -340,7 +340,7 @@ namespace tut
LLPointer
<
LLSecAPIBasicHandler
>
handler
=
new
LLSecAPIBasicHandler
(
"sechandler_settings.tmp"
,
"test_password.dat"
);
handler
.
init
();
handler
->
init
();
// data retrieval for existing data
LLSD
data
=
handler
->
getProtectedData
(
"test_data_type"
,
"test_data_id"
);
...
...
@@ -398,7 +398,7 @@ namespace tut
// cause a 'write' by using 'LLPointer' to delete then instantiate a handler
handler
=
NULL
;
handler
=
new
LLSecAPIBasicHandler
(
"sechandler_settings.tmp"
,
"test_password.dat"
);
handler
.
init
();
handler
->
init
();
data
=
handler
->
getProtectedData
(
"test_data_type1"
,
"test_data_id"
);
ensure_equals
(
"verify datatype stored data3a"
,
(
std
::
string
)
data
[
"store_data3"
],
"test_store_data3"
);
...
...
@@ -413,7 +413,7 @@ namespace tut
// cause a 'write'
handler
=
new
LLSecAPIBasicHandler
(
"sechandler_settings.tmp"
,
"test_password.dat"
);
handler
.
init
();
handler
->
init
();
data
=
handler
->
getProtectedData
(
"test_data_type1"
,
"test_data_id"
);
ensure
(
"not found"
,
data
.
isUndefined
());
...
...
@@ -422,7 +422,7 @@ namespace tut
LLFile
::
remove
(
"sechandler_settings.tmp"
);
handler
=
new
LLSecAPIBasicHandler
(
"sechandler_settings.tmp"
,
"test_password.dat"
);
handler
.
init
();
handler
->
init
();
data
=
handler
->
getProtectedData
(
"test_data_type1"
,
"test_data_id"
);
ensure
(
"not found"
,
data
.
isUndefined
());
handler
=
NULL
;
...
...
@@ -435,7 +435,7 @@ namespace tut
void
sechandler_basic_test_object
::
test
<
3
>
()
{
LLPointer
<
LLSecAPIBasicHandler
>
handler
=
new
LLSecAPIBasicHandler
(
"sechandler_settings.tmp"
,
"test_password.dat"
);
handler
.
init
();
handler
->
init
();
LLSD
my_id
=
LLSD
::
emptyMap
();
LLSD
my_authenticator
=
LLSD
::
emptyMap
();
...
...
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