From 0ec1ceca1f086bdf9e54cc9c4b7857ae6272fc98 Mon Sep 17 00:00:00 2001
From: Mat M <mathew1800@gmail.com>
Date: Fri, 23 Feb 2018 08:40:38 -0500
Subject: [PATCH] sealedkeys: Fix compilation issues (#39)

* sealedkeys: Remove non-existent variable in condition in seal_titlekey

* sealedkeys: call unseal_key_internal in unseal_key instead of seal_key_internal
---
 exosphere/sealedkeys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/exosphere/sealedkeys.c b/exosphere/sealedkeys.c
index cfcf890e7..42c0b89e7 100644
--- a/exosphere/sealedkeys.c
+++ b/exosphere/sealedkeys.c
@@ -28,7 +28,7 @@ void unseal_key_internal(unsigned int keyslot, const void *src, const uint8_t *s
 
 
 void seal_titlekey(void *dst, size_t dst_size, const void *src, size_t src_size) {
-    if (usecase >= CRYPTOUSECASE_MAX || dst_size != 0x10 || src_size != 0x10) {
+    if (dst_size != 0x10 || src_size != 0x10) {
         panic();
     }
     
@@ -59,5 +59,5 @@ void unseal_key(unsigned int keyslot, const void *src, size_t src_size, unsigned
         panic();
     }
     
-    seal_key_internal(dst, src, g_seal_key_sources[usecase]);
+    unseal_key_internal(keyslot, src, g_seal_key_sources[usecase]);
 }
\ No newline at end of file