Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
portal-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
portal
portal-core
Commits
88ad3953
Commit
88ad3953
authored
13 years ago
by
da1l6
Browse files
Options
Downloads
Patches
Plain Diff
Disable keystore content output in non-debug mode.
parent
0ca12760
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Control/keystore.c
+8
-4
8 additions, 4 deletions
Control/keystore.c
with
8 additions
and
4 deletions
Control/keystore.c
+
8
−
4
View file @
88ad3953
...
...
@@ -117,13 +117,15 @@ void keystore_update_hashes(SALT salt){
}
void
keystore_list
(
void
){
KEY
key
;
for
(
uint16_t
index
=
0
;
index
<
KEY_COUNT
;
index
++
){
wdt_reset
();
//this may take a while, keep the Watchdog happy.
printf_P
(
PSTR
(
"Slot %03i: "
),
index
);
uint8_t
slot_status
=
keystore_read_slot_status
(
index
);
if
(
slot_status
==
KEYSLOT_USED
||
slot_status
==
KEYSLOT_DISABLED
){
#ifdef KEYSTORE_DEBUG
KEY
key
;
keystore_read_key
(
index
,
key
);
printf_P
(
PSTR
(
"K:"
));
...
...
@@ -131,7 +133,9 @@ void keystore_list(void){
printf_P
(
PSTR
(
" H:"
));
MGMT_transmit_buffer_hex
(
&
(
hashes
[
index
]),
sizeof
(
HASH_HEAD
));
#else
printf_P
(
PSTR
(
"Used"
));
#endif
if
(
slot_status
==
KEYSLOT_DISABLED
){
printf_P
(
PSTR
(
" (Disabled)"
));
}
...
...
@@ -158,7 +162,7 @@ uint8_t keystore_calc_keyhash(uint16_t index, SALT salt, HASH keyhash){
MGMT_transmit_buffer_hex
(
buffer
,
sizeof
(
SALT
)
+
sizeof
(
KEY
));
printf_P
(
PSTR
(
")
\n
"
));
#endif
sha1
(
keyhash
,
buffer
,
(
sizeof
(
SALT
)
+
sizeof
(
KEY
))
*
8
);
sha1
(
keyhash
,
(
uint8_t
*
)
buffer
,
(
sizeof
(
SALT
)
+
sizeof
(
KEY
))
*
8
);
return
1
;
}
...
...
@@ -172,7 +176,7 @@ uint8_t keystore_restore_slot(uint16_t index){
if
(
!
keystore_eeprom_write
(
KEY_MAIN_EEPROM
,
EEPROM_TABLE_OFFSET
+
index
,
&
status
,
sizeof
(
uint8_t
)))
return
0
;
if
(
status
==
KEYSLOT_USED
||
status
==
KEYSLOT_DISABLED
){
keystore_calc_keyhash
(
index
,
salt
,
&
hashes
[
index
]);
keystore_calc_keyhash
(
index
,
salt
,
(
uint8_t
*
)
&
hashes
[
index
]);
}
return
1
;
...
...
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