Commit 1577632d authored by bernd's avatar bernd

make pubkey pair

parent 675087c8
......@@ -23,7 +23,7 @@ init-client
revoke-me ;
: c:bob ( -- )
$2000 $10000 "test" ins-ip dup add-beacon c:connect
$2000 $10000 "" ins-ip dup add-beacon c:connect
." Bob connected with: " pkc $20 85type cr
c:revoke-bob
." Bob revoked: " pkc $20 85type cr
......
......@@ -275,6 +275,16 @@ set-current previous previous
: +keypair ( type nick u -- ) +passphrase +gen-keys ;
: .rvk ." Please write down revoke key: " cr
skrev $20 bounds DO ." \ " I 4 85type space I 4 + 4 85type cr 8 +LOOP ;
$40 buffer: nick-buf
: make-key ( -- )
key#user ." nick: " nick-buf $40 accept nick-buf swap cr
." passphrase: " +passphrase keys $[]# 1- keys sec[]@ key+len 2!
cr +gen-keys .rvk ;
\ read key file
: try-decrypt-key ( key u1 -- addr u2 true / false )
......
......@@ -2523,7 +2523,7 @@ require net2o-msg.fs
cookie+request
end-code| -setip n2o:send-replace ;
: lookup ( addr u -- id u )
: nick-lookup ( addr u -- id u )
$2000 $10000 "" ins-ip c:connect
2dup c:addme-fetch-host
nick-key >o ke-pk $@
......@@ -2544,7 +2544,7 @@ require net2o-msg.fs
ELSE 2drop THEN ;
: n2o:lookup ( addr u -- )
2dup lookup
2dup nick-lookup
0 n2o:new-context >o rdrop 2dup dest-key return-addr $10 erase
nick-key .ke-pk $@ >d#id >o dht-host ['] insert-host $[]map o> ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment