diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index 0cc2ef705..9d69f7880 100755 --- a/iguana/SuperNET.c +++ b/iguana/SuperNET.c @@ -1410,27 +1410,21 @@ struct supernet_info *SuperNET_accountfind(cJSON *json) FOUR_STRINGS(SuperNET,login,handle,password,permanentfile,passphrase) { - char *argstr,*str,*decryptstr = 0; cJSON *argjson; //uint32_t expire = myinfo->expiration; //savehandle[1024],savepassword[1024],savepermanentfile[1024] + char *argstr,*str,*decryptstr = 0; cJSON *argjson; if ( remoteaddr != 0 ) return(clonestr("{\"error\":\"no remote\"}")); - //safecopy(savehandle,myinfo->handle,sizeof(myinfo->handle)); - //safecopy(savepassword,myinfo->secret,sizeof(myinfo->secret)); - //safecopy(savepermanentfile,myinfo->permanentfile,sizeof(myinfo->permanentfile)); - //if ( bits256_nonz(myinfo->persistent_priv) != 0 && (str= SuperNET_logout(IGUANA_CALLARGS)) != 0 ) - // free(str); - //myinfo->expiration = expire; if ( handle != 0 && handle[0] != 0 ) safecopy(myinfo->handle,handle,sizeof(myinfo->handle)); else memset(myinfo->handle,0,sizeof(myinfo->handle)); - if ( password != 0 && password[0] != 0 ) + if ( password == 0 || password[0] == 0 ) + password = passphrase; + /*if ( password != 0 && password[0] != 0 ) safecopy(myinfo->secret,password,sizeof(myinfo->secret)); else if ( passphrase != 0 && passphrase[0] != 0 ) - safecopy(myinfo->secret,passphrase,sizeof(myinfo->secret)); - //else memset(myinfo->secret,0,sizeof(myinfo->secret)); + safecopy(myinfo->secret,passphrase,sizeof(myinfo->secret));*/ if ( permanentfile != 0 ) safecopy(myinfo->permanentfile,permanentfile,sizeof(myinfo->permanentfile)); - //else memset(myinfo->permanentfile,0,sizeof(myinfo->permanentfile)); - if ( (decryptstr= SuperNET_decryptjson(IGUANA_CALLARGS,myinfo->secret,myinfo->permanentfile)) != 0 ) + if ( (decryptstr= SuperNET_decryptjson(IGUANA_CALLARGS,password,myinfo->permanentfile)) != 0 ) { if ( (argjson= cJSON_Parse(decryptstr)) != 0 ) { @@ -1472,12 +1466,11 @@ FOUR_STRINGS(SuperNET,login,handle,password,permanentfile,passphrase) } else argjson = cJSON_CreateObject(); jaddstr(argjson,"passphrase",passphrase); argstr = jprint(argjson,1); - if ( (str= SuperNET_encryptjson(IGUANA_CALLARGS,myinfo->secret,myinfo->permanentfile,argstr)) != 0 ) + if ( (str= SuperNET_encryptjson(IGUANA_CALLARGS,password,myinfo->permanentfile,argstr)) != 0 ) free(str); free(argstr); return(SuperNET_activehandle(IGUANA_CALLARGS)); - } - else return(clonestr("{\"error\":\"need passphrase\"}")); + } else return(clonestr("{\"error\":\"need passphrase\"}")); printf("logged into (%s) %s %s\n",myinfo->myaddr.NXTADDR,myinfo->myaddr.BTC,myinfo->myaddr.BTCD); return(SuperNET_activehandle(IGUANA_CALLARGS)); } diff --git a/iguana/SuperNET_keys.c b/iguana/SuperNET_keys.c index 999ed6c0e..0864afa9f 100755 --- a/iguana/SuperNET_keys.c +++ b/iguana/SuperNET_keys.c @@ -202,7 +202,7 @@ cJSON *SuperNET_decryptedjson(char *destfname,char *passphrase,int32_t passsize, wallethash = SuperNET_linehash(passphrase); SuperNET_linehash(fname2fa); // maps special chars wallet2priv = SuperNET_wallet2priv(fname2fa,wallethash); - //char str[65],str2[65]; printf("(%s + %s) -> wallethash.%s 2.(%s)\n",passphrase,fname2fa,bits256_str(str,wallethash),bits256_str(str2,wallet2priv)); + char str[65],str2[65]; printf("(%s + %s) -> wallethash.%s 2.(%s)\n",passphrase,fname2fa,bits256_str(str,wallethash),bits256_str(str2,wallet2priv)); } first = (bits256_nonz(wallethash) != 0 && bits256_cmp(wallethash,GENESIS_PRIVKEY) != 0); second = (bits256_nonz(wallet2priv) != 0 && bits256_cmp(wallet2priv,GENESIS_PRIVKEY) != 0); @@ -213,7 +213,7 @@ cJSON *SuperNET_decryptedjson(char *destfname,char *passphrase,int32_t passsize, wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv); wallet2pub = curve25519(wallet2shared,curve25519_basepoint9()); sprintf(destfname,"confs/%s",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 ( (filejson= cJSON_Parse(confstr)) != 0 ) diff --git a/iguana/chart.html b/iguana/chart.html new file mode 100755 index 000000000..510a34544 --- /dev/null +++ b/iguana/chart.html @@ -0,0 +1,168 @@ + + +
+ +