Commit ced820d6 authored by bernd's avatar bernd

Conversion to use temporary 0keys only during connection setup

parent bae76eee
......@@ -189,10 +189,8 @@ User last-ivskey
: inbuf0-decrypt ( -- flag ) +calc
inbuf addr 64@ inbuf flags w@ addr>assembly
my-0key try-0decrypt dup IF EXIT THEN drop
contexts BEGIN @ dup WHILE >o
." inbuf0 context " o hex.
next-context dest-0key try-0decrypt o>
dup IF nip EXIT THEN drop REPEAT ;
0 [: ." inbuf0 context " o hex.
dest-0key try-0decrypt or dup 0= ;] search-context ;
: outbuf0-encrypt ( -- ) +calc
outbuf addr 64@ outbuf flags w@ addr>assembly
......
......@@ -1228,6 +1228,30 @@ Variable mapstart $1 mapstart !
' free-rcode rdata-class to free-data
' free-rcode rcode-class to free-data
\ symmetric key management and searching in open connections
: search-context ( .. xt -- .. ) { xt }
contexts BEGIN @ dup WHILE >o xt execute
next-context o> swap 0= UNTIL THEN drop ;
Variable 0keys
sema 0key-sema
: ins-0key [: { w^ addr -- }
addr cell 0keys $+! ;] 0key-sema c-section ;
: del-0key ( addr -- )
[: 0keys $@ bounds ?DO
dup I @ = IF
0keys I over @ - cell $del LEAVE
THEN
cell +LOOP drop ;] 0key-sema c-section ;
: search-0key ( .. xt -- .. )
[: { xt } 0keys $@ bounds ?DO
I xt execute 0= ?LEAVE
cell +LOOP
;] 0key-sema c-section ;
\ data sending around
: >blockalign ( n -- block )
......
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