|
@ -219,12 +219,12 @@ cJSON *SuperNET_decryptedjson(char *destfname,char *passphrase,int32_t passsize, |
|
|
wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv); |
|
|
wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv); |
|
|
wallet2pub = curve25519(wallet2shared,curve25519_basepoint9()); |
|
|
wallet2pub = curve25519(wallet2shared,curve25519_basepoint9()); |
|
|
sprintf(destfname,"%s/%s",GLOBAL_CONFSDIR,bits256_str(str,wallet2pub)); |
|
|
sprintf(destfname,"%s/%s",GLOBAL_CONFSDIR,bits256_str(str,wallet2pub)); |
|
|
//printf("fname.(%s) wallet2pub.%s < [%s, %s]\n",destfname,bits256_str(str,wallet2pub),passphrase,fname2fa);
|
|
|
printf("fname.(%s) wallet2pub.%s < [%s, %s]\n",destfname,bits256_str(str,wallet2pub),passphrase,fname2fa); |
|
|
if ( (confstr= OS_filestr(&allocsize,destfname)) != 0 ) |
|
|
if ( (confstr= OS_filestr(&allocsize,destfname)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( (filejson= cJSON_Parse(confstr)) != 0 ) |
|
|
if ( (filejson= cJSON_Parse(confstr)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
//printf("confstr.(%s)\n",confstr);
|
|
|
printf("confstr.(%s)\n",confstr); |
|
|
if ( (deciphered= SuperNET_decipher(0,0,0,0,wallet2shared,curve25519(wallethash,curve25519_basepoint9()),jstr(filejson,"result"))) != 0 ) |
|
|
if ( (deciphered= SuperNET_decipher(0,0,0,0,wallet2shared,curve25519(wallethash,curve25519_basepoint9()),jstr(filejson,"result"))) != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( (json= cJSON_Parse(deciphered)) == 0 ) |
|
|
if ( (json= cJSON_Parse(deciphered)) == 0 ) |
|
@ -269,7 +269,7 @@ int32_t _SuperNET_encryptjson(struct supernet_info *myinfo,char *destfname,char |
|
|
wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv); |
|
|
wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv); |
|
|
wallet2pub = curve25519(wallet2shared,curve25519_basepoint9()); |
|
|
wallet2pub = curve25519(wallet2shared,curve25519_basepoint9()); |
|
|
sprintf(destfname,"%s/%s",GLOBAL_CONFSDIR,bits256_str(str,wallet2pub)); |
|
|
sprintf(destfname,"%s/%s",GLOBAL_CONFSDIR,bits256_str(str,wallet2pub)); |
|
|
//printf("SAVE ARGJSON.(%s) [%s, %s] -> destfname.(%s)\n",jprint(argjson,0),passphrase,fname2fa,destfname);
|
|
|
printf("SAVE ARGJSON.(%s) [%s, %s] -> destfname.(%s)\n",jprint(argjson,0),passphrase,fname2fa,destfname); |
|
|
//printf("shared.%llx -> pub.%s\n",(long long)wallet2shared.txid,bits256_str(str,wallet2pub));
|
|
|
//printf("shared.%llx -> pub.%s\n",(long long)wallet2shared.txid,bits256_str(str,wallet2pub));
|
|
|
SuperNET_savejsonfile(myinfo,destfname,wallethash,wallet2pub,argjson); |
|
|
SuperNET_savejsonfile(myinfo,destfname,wallethash,wallet2pub,argjson); |
|
|
return(0); |
|
|
return(0); |
|
|