diff options
Diffstat (limited to 'src/core/crypto/key_manager.cpp')
| -rw-r--r-- | src/core/crypto/key_manager.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index 65d246050..cebe2ce37 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp | |||
| @@ -143,6 +143,7 @@ u64 GetSignatureTypeDataSize(SignatureType type) { | |||
| 143 | return 0x3C; | 143 | return 0x3C; |
| 144 | } | 144 | } |
| 145 | UNREACHABLE(); | 145 | UNREACHABLE(); |
| 146 | return 0; | ||
| 146 | } | 147 | } |
| 147 | 148 | ||
| 148 | u64 GetSignatureTypePaddingSize(SignatureType type) { | 149 | u64 GetSignatureTypePaddingSize(SignatureType type) { |
| @@ -157,6 +158,7 @@ u64 GetSignatureTypePaddingSize(SignatureType type) { | |||
| 157 | return 0x40; | 158 | return 0x40; |
| 158 | } | 159 | } |
| 159 | UNREACHABLE(); | 160 | UNREACHABLE(); |
| 161 | return 0; | ||
| 160 | } | 162 | } |
| 161 | 163 | ||
| 162 | SignatureType Ticket::GetSignatureType() const { | 164 | SignatureType Ticket::GetSignatureType() const { |
| @@ -169,8 +171,7 @@ SignatureType Ticket::GetSignatureType() const { | |||
| 169 | if (const auto* ticket = std::get_if<ECDSATicket>(&data)) { | 171 | if (const auto* ticket = std::get_if<ECDSATicket>(&data)) { |
| 170 | return ticket->sig_type; | 172 | return ticket->sig_type; |
| 171 | } | 173 | } |
| 172 | 174 | throw std::bad_variant_access{}; | |
| 173 | UNREACHABLE(); | ||
| 174 | } | 175 | } |
| 175 | 176 | ||
| 176 | TicketData& Ticket::GetData() { | 177 | TicketData& Ticket::GetData() { |
| @@ -183,8 +184,7 @@ TicketData& Ticket::GetData() { | |||
| 183 | if (auto* ticket = std::get_if<ECDSATicket>(&data)) { | 184 | if (auto* ticket = std::get_if<ECDSATicket>(&data)) { |
| 184 | return ticket->data; | 185 | return ticket->data; |
| 185 | } | 186 | } |
| 186 | 187 | throw std::bad_variant_access{}; | |
| 187 | UNREACHABLE(); | ||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | const TicketData& Ticket::GetData() const { | 190 | const TicketData& Ticket::GetData() const { |
| @@ -197,8 +197,7 @@ const TicketData& Ticket::GetData() const { | |||
| 197 | if (const auto* ticket = std::get_if<ECDSATicket>(&data)) { | 197 | if (const auto* ticket = std::get_if<ECDSATicket>(&data)) { |
| 198 | return ticket->data; | 198 | return ticket->data; |
| 199 | } | 199 | } |
| 200 | 200 | throw std::bad_variant_access{}; | |
| 201 | UNREACHABLE(); | ||
| 202 | } | 201 | } |
| 203 | 202 | ||
| 204 | u64 Ticket::GetSize() const { | 203 | u64 Ticket::GetSize() const { |
| @@ -411,7 +410,7 @@ Loader::ResultStatus DeriveSDKeys(std::array<Key256, 2>& sd_keys, KeyManager& ke | |||
| 411 | // Combine sources and seed | 410 | // Combine sources and seed |
| 412 | for (auto& source : sd_key_sources) { | 411 | for (auto& source : sd_key_sources) { |
| 413 | for (std::size_t i = 0; i < source.size(); ++i) { | 412 | for (std::size_t i = 0; i < source.size(); ++i) { |
| 414 | source[i] ^= sd_seed[i & 0xF]; | 413 | source[i] = static_cast<u8>(source[i] ^ sd_seed[i & 0xF]); |
| 415 | } | 414 | } |
| 416 | } | 415 | } |
| 417 | 416 | ||