Support list of extra keys to check in `/mod/etc/keys`

This commit is contained in:
df 2020-10-22 16:27:46 +00:00
parent 4eedc2bd33
commit f766ba01ff
1 changed files with 19 additions and 1 deletions

View File

@ -843,7 +843,7 @@ ts method getkey {mode} {
lappend keys $key
}
if { $mode ne "dlna" } {
# also try other keys, such as the native key
# also try other keys, such as the native key
if {![catch {set fd [open "/mod/boot/cryptokey"]}]} {
set bytes [$fd read 16]
$fd close
@ -858,6 +858,24 @@ ts method getkey {mode} {
if {$key ni $keys} {
lappend keys $key
}
try {
set fd [open "/mod/etc/keys" r]
set xkeys [split [$fd read -nonewline] "\n"]
$fd close
} on error {
set xkeys {}
} finally {
foreach key $xkeys {
if {$key ni $keys} {
lappend keys $key
}
}
}
foreach key $xkeys {
if {$key ni $keys} {
lappend keys $key
}
}
}
foreach key $keys {