-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: urcd action: commit revision: path_from: revision_from: 6b74756f463f24b3e5205a1a5de4bae3a471148c: path_to: revision_to:
commit 6b74756f463f24b3e5205a1a5de4bae3a471148c Author: root <root@localhost> Date: Tue May 12 03:02:31 2015 +0000 [cryptoserv.c] IDENTSIG, IDENTENC, indentify using only encryption or only signatures. (thanks epoch) diff --git a/src/cryptoserv.c b/src/cryptoserv.c
--- a/src/cryptoserv.c +++ b/src/cryptoserv.c @@ -221,7 +221,14 @@ main(int argc, char *argv[]) usleep((int)(LIMIT*1000000)); /// IDENTIFY - if ((i>=20+9+1+1)&&(!memcmp("identify ",buffer1+20,9))) { + if ((i>=20+5+1+1)&&(!memcmp("ident",buffer1+20,5))) { + int epochsucks=0; + if ((i>=20+9+1+1)&&(!memcmp("identify ",buffer1+20,9))) epochsucks=192; + if ((i>=20+9+1+1)&&(!memcmp("identsig ",buffer1+20,9))) epochsucks=128; + if ((i>=20+9+1+1)&&(!memcmp("identenc ",buffer1+20,9))) epochsucks=64; +// if ((i>=20+9+1+1)&&(!memcmp("identoff ",buffer1+20,9))) epochsucks=0;//dunno how to do this yet. + if(epochsucks == 0) continue; + if (loginattempts == 4) goto invalid_passwd; ++loginattempts; bzero(path,512); @@ -261,9 +268,9 @@ main(int argc, char *argv[]) base16_encode(hex,sk,32); base16_encode(hex+64,sk,64); memcpy(buffer0,"PASS ",5); - memcpy(buffer0+5,hex,192); - memcpy(buffer0+5+192,"\n",1); - if (write(1,buffer0,5+192+1)<=0) exit(8); + memcpy(buffer0+5,hex+((epochsucks==128)?64:0),epochsucks); + memcpy(buffer0+5+epochsucks,"\n",1); + if (write(1,buffer0,5+epochsucks+1)<=0) exit(8); memcpy(buffer2+2+12+4+8+32+nicklen+2,"Success\n",8); write(sfd,buffer2,2+12+4+8+32+nicklen+2+8); memcpy(identifiednick,buffer2+2+12+4+8+32,nicklen); diff --git a/src/urcd.pyx b/src/urcd.pyx
--- a/src/urcd.pyx +++ b/src/urcd.pyx @@ -134,14 +134,6 @@ def try_write(fd,buffer): if time.time() - now >= TIMEOUT: sock_close(3,0) time.sleep(1) -### NaCl's crypto_sign / crypto_sign_open API sucks ### -def _crypto_sign(m,sk): - s = crypto_sign(m,sk) - return s[:32]+s[-32:] - -def _crypto_sign_open(m,s,pk): - return 1 if crypto_sign_open(s[:32]+m+s[32:],pk) != 0 else 0 - urcsecretboxdb, urccryptoboxdb, urccryptoboxpfsdb, urccryptoboxpassdb = dict(), dict(), dict(), dict() if URCSECRETBOXDIR:
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 16:38:39 2024