summaryrefslogtreecommitdiff
path: root/src/core/crypto/key_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/crypto/key_manager.h')
-rw-r--r--src/core/crypto/key_manager.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h
index 589b25696..8a67b172d 100644
--- a/src/core/crypto/key_manager.h
+++ b/src/core/crypto/key_manager.h
@@ -165,15 +165,27 @@ public:
165 bool BaseDeriveNecessary() const; 165 bool BaseDeriveNecessary() const;
166 void DeriveBase(); 166 void DeriveBase();
167 void DeriveETicket(PartitionDataManager& data); 167 void DeriveETicket(PartitionDataManager& data);
168 void PopulateTickets();
168 169
169 void PopulateFromPartitionData(PartitionDataManager& data); 170 void PopulateFromPartitionData(PartitionDataManager& data);
170 171
172 const std::map<u128, TicketRaw>& GetCommonTickets() const;
173 const std::map<u128, TicketRaw>& GetPersonalizedTickets() const;
174
175 bool AddTicketCommon(TicketRaw raw);
176 bool AddTicketPersonalized(TicketRaw raw);
177
171private: 178private:
172 std::map<KeyIndex<S128KeyType>, Key128> s128_keys; 179 std::map<KeyIndex<S128KeyType>, Key128> s128_keys;
173 std::map<KeyIndex<S256KeyType>, Key256> s256_keys; 180 std::map<KeyIndex<S256KeyType>, Key256> s256_keys;
174 181
182 // Map from rights ID to ticket
183 std::map<u128, TicketRaw> common_tickets;
184 std::map<u128, TicketRaw> personal_tickets;
185
175 std::array<std::array<u8, 0xB0>, 0x20> encrypted_keyblobs{}; 186 std::array<std::array<u8, 0xB0>, 0x20> encrypted_keyblobs{};
176 std::array<std::array<u8, 0x90>, 0x20> keyblobs{}; 187 std::array<std::array<u8, 0x90>, 0x20> keyblobs{};
188 std::array<u8, 576> eticket_extended_kek{};
177 189
178 bool dev_mode; 190 bool dev_mode;
179 void LoadFromFile(const std::string& filename, bool is_title_keys); 191 void LoadFromFile(const std::string& filename, bool is_title_keys);
@@ -185,6 +197,8 @@ private:
185 197
186 void DeriveGeneralPurposeKeys(std::size_t crypto_revision); 198 void DeriveGeneralPurposeKeys(std::size_t crypto_revision);
187 199
200 RSAKeyPair<2048> GetETicketRSAKey();
201
188 void SetKeyWrapped(S128KeyType id, Key128 key, u64 field1 = 0, u64 field2 = 0); 202 void SetKeyWrapped(S128KeyType id, Key128 key, u64 field1 = 0, u64 field2 = 0);
189 void SetKeyWrapped(S256KeyType id, Key256 key, u64 field1 = 0, u64 field2 = 0); 203 void SetKeyWrapped(S256KeyType id, Key256 key, u64 field1 = 0, u64 field2 = 0);
190 204