mirror of
https://github.com/rvtr/ctr_eFuse.git
synced 2025-11-02 00:11:04 -04:00
AESインポートの修正をECDSAインポートに逆輸入
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@146 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
parent
5f36638c42
commit
f748831d4a
@ -24,8 +24,8 @@
|
|||||||
#include "my_hsm_bignum.h"
|
#include "my_hsm_bignum.h"
|
||||||
#include "my_hsm_alloc.h"
|
#include "my_hsm_alloc.h"
|
||||||
|
|
||||||
#define PRIV_KEY_FILE "/opt/nfast/work/hoge/ctr_eFuse/dummyKey/dev/NintendoCTR2_priv_dummy.der"
|
#define PRIV_KEY_FILE "/opt/nfast/work/ctr_eFuse/hsm_utils/real_key/hoge/NintendoCTR2_privkey_prod.der"
|
||||||
#define PUB_KEY_FILE "/opt/nfast/work/hoge/ctr_eFuse/dummyKey/dev/NintendoCTR2_pub_dummy.der"
|
#define PUB_KEY_FILE "/opt/nfast/work/ctr_eFuse/hsm_utils/real_key/hoge/NintendoCTR2_pubkey_prod.der"
|
||||||
|
|
||||||
#define MODULE_ID 1
|
#define MODULE_ID 1
|
||||||
#define DATA_LEN 256 // bytes
|
#define DATA_LEN 256 // bytes
|
||||||
@ -61,8 +61,8 @@ RQCard_FIPS fips;
|
|||||||
M_KeyID ltid = 0; // the cardset loaded into the module
|
M_KeyID ltid = 0; // the cardset loaded into the module
|
||||||
NFKM_CardSet *cardset = NULL;
|
NFKM_CardSet *cardset = NULL;
|
||||||
NFKM_ModuleInfo *moduleinfo = NULL;
|
NFKM_ModuleInfo *moduleinfo = NULL;
|
||||||
const NFKM_KeyIdent priv_keyident = { (char*)"simple", (char*)"nintendo-ctr2-priv-dummy-dev" };
|
const NFKM_KeyIdent priv_keyident = { (char*)"simple", (char*)"nct2-priv-hoge" };
|
||||||
const NFKM_KeyIdent pub_keyident = { (char*)"simple", (char*)"nintendo-ctr2-pub-dummy-dev" };
|
const NFKM_KeyIdent pub_keyident = { (char*)"simple", (char*)"nct2-pub-hoge" };
|
||||||
|
|
||||||
unsigned char save_enc[DATA_LEN];
|
unsigned char save_enc[DATA_LEN];
|
||||||
|
|
||||||
@ -100,6 +100,7 @@ int importECDSAPrivate( NFKM_KeyIdent keyident )
|
|||||||
memset( &privBn, 0, sizeof( privBn ) );
|
memset( &privBn, 0, sizeof( privBn ) );
|
||||||
|
|
||||||
// key data open
|
// key data open
|
||||||
|
printf( "priv key file : %s\n", PRIV_KEY_FILE );
|
||||||
fp = fopen( PRIV_KEY_FILE, "rb" );
|
fp = fopen( PRIV_KEY_FILE, "rb" );
|
||||||
if ( !fp )
|
if ( !fp )
|
||||||
{
|
{
|
||||||
@ -229,6 +230,9 @@ int importECDSAPrivate( NFKM_KeyIdent keyident )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf( "priv key record success : appname=%s, ident=%s\n",
|
||||||
|
priv_keyident.appname, priv_keyident.ident );
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} // importECDSAPrivate
|
} // importECDSAPrivate
|
||||||
|
|
||||||
@ -258,6 +262,7 @@ int importECDSAPublic( NFKM_KeyIdent keyident )
|
|||||||
memset( &pubBn, 0, sizeof( pubBn ) );
|
memset( &pubBn, 0, sizeof( pubBn ) );
|
||||||
|
|
||||||
// key data open
|
// key data open
|
||||||
|
printf( "pub key file : %s\n", PUB_KEY_FILE );
|
||||||
fp = fopen( PUB_KEY_FILE, "rb" );
|
fp = fopen( PUB_KEY_FILE, "rb" );
|
||||||
if ( !fp )
|
if ( !fp )
|
||||||
{
|
{
|
||||||
@ -400,6 +405,9 @@ int importECDSAPublic( NFKM_KeyIdent keyident )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf( "pub key record success : appname=%s, ident=%s\n",
|
||||||
|
pub_keyident.appname, pub_keyident.ident );
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} // importECDSAPublic
|
} // importECDSAPublic
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user