From 9cb9c66756563798fb4a28cab0509deb5fddc72c Mon Sep 17 00:00:00 2001 From: SocraticBliss Date: Fri, 18 May 2018 14:12:57 -0500 Subject: [PATCH] Fixed TitleKey and BodyKey implementation. --- programs/nstool/source/UserSettings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/nstool/source/UserSettings.cpp b/programs/nstool/source/UserSettings.cpp index d50db04..eab606e 100644 --- a/programs/nstool/source/UserSettings.cpp +++ b/programs/nstool/source/UserSettings.cpp @@ -417,7 +417,7 @@ void UserSettings::populateKeyset(sCmdArgs& args) // save keydata from input args if (args.nca_bodykey.isSet) { - if (args.nca_bodykey.var.length() == (sizeof(crypto::aes::sAes128Key)*2)) + if (args.nca_bodykey.var.length() != (sizeof(crypto::aes::sAes128Key)*2)) { decodeHexStringToBytes("--bodykey", args.nca_bodykey.var, mKeyset.nca.manual_body_key_aesctr.key, sizeof(crypto::aes::sAes128Key)); } @@ -429,7 +429,7 @@ void UserSettings::populateKeyset(sCmdArgs& args) if (args.nca_titlekey.isSet) { - if (args.nca_bodykey.var.length() == (sizeof(crypto::aes::sAes128Key)*2)) + if (args.nca_bodykey.var.length() != (sizeof(crypto::aes::sAes128Key)*2)) { decodeHexStringToBytes("--titlekey", args.nca_titlekey.var, mKeyset.nca.manual_title_key_aesctr.key, sizeof(crypto::aes::sAes128Key)); }