Check-in [901360a4c6]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Test otrify, works
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 901360a4c636ab140823e6f25e139c7664b9411f
User & Date: bernd 2019-08-21 21:01:08
Context
2019-08-22
11:22
Bump version number check-in: c7456d90e9 user: bernd tags: trunk, 0.9.1-20190822
2019-08-21
21:01
Test otrify, works check-in: 901360a4c6 user: bernd tags: trunk
20:04
Add preferrence ipv6/ipv4 switch for dht connection check-in: e961e252cc user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to addr.fs.

125
126
127
128
129
130
131
132

133
134
135



136
137
138

139
140
141
142
143
144
145

: addr>4sock ( -- )
    host:key @ dest-0key< !
    host:portv4 w@ sockaddr1 port be-w!
    host:ipv4 be-ul@ sockaddr1 ipv4!
    host:route $@ !temp-addr ;

: addr>sock6 { xt -- }

    ipv6( host:ipv6 ip6?   IF  addr>6sock o o> >r xt execute  r> >o THEN ) ;
: addr>sock4 { xt -- }
    ipv4( host:ipv4 be-ul@ IF  addr>4sock o o> >r xt execute  r> >o THEN ) ;




: addr>sock ( o xt -- ) { xt } >o
    ipv64( xt addr>sock6 xt addr>sock4 )else( xt addr>sock4 xt addr>sock6 ) o> ;


: +my-id ( -- )
    config:prio# @ host:pri# !
    host$ $@ host:id $!
    my-0key @ IF  my-0key sec@ host:key sec!  THEN ;

: +my-addrs ( port o:addr -- )







|
>
|
<
|
>
>
>
|
<
<
>







125
126
127
128
129
130
131
132
133
134

135
136
137
138
139


140
141
142
143
144
145
146
147

: addr>4sock ( -- )
    host:key @ dest-0key< !
    host:portv4 w@ sockaddr1 port be-w!
    host:ipv4 be-ul@ sockaddr1 ipv4!
    host:route $@ !temp-addr ;

: addr>sock ( o xt -- ) { xt } >o
    ipv64(
    ipv6( host:ipv6 ip6?   IF  addr>6sock o o> >r xt execute  r> >o THEN )

    ipv4( host:ipv4 be-ul@ IF  addr>4sock o o> >r xt execute  r> >o THEN )
    )else(
    ipv4( host:ipv4 be-ul@ IF  addr>4sock o o> >r xt execute  r> >o THEN )
    ipv6( host:ipv6 ip6?   IF  addr>6sock o o> >r xt execute  r> >o THEN )
    )


    o> ;

: +my-id ( -- )
    config:prio# @ host:pri# !
    host$ $@ host:id $!
    my-0key @ IF  my-0key sec@ host:key sec!  THEN ;

: +my-addrs ( port o:addr -- )

Changes to msg.fs.

525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
    ELSE  pk-sig?  THEN ;

: msg-dec?-sig? ( addr u -- addr' u' flag )
    2dup 2 - + c@ $80 and IF  msg-dec-sig?  ELSE  msg-sig?  THEN ;

: replace-sig { addrsig usig addrmsg umsg -- }
    addrsig usig addrmsg umsg usig - [: type type ;] $tmp
    2dup dump
    2dup msg-dec?-sig? !!sig!! 2drop addrmsg umsg smove ;
: new-otrsig ( addr u flag -- addrsig usig )
    >r 2dup startdate@ old>otr
    predate-key keccak# c:key@ c:key# smove
    [: sktmp pkmod sk@ drop >modkey .encsign-rest ;]
    ['] .sig r@ select $tmp
    2dup + 2 - r> swap orc!
    2dup dump 1 64s /string ;

:noname { sig u' addr u -- }
    u' 64'+ u =  u sigsize# = and IF
	last# >r last# $@ >group
	addr u startdate@ 64dup date>i >r 64#1 64+ date>i' r>
	2dup = IF  ."  [otrified] "  addr u startdate@ .ticks  THEN
	U+DO







<







|







525
526
527
528
529
530
531

532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
    ELSE  pk-sig?  THEN ;

: msg-dec?-sig? ( addr u -- addr' u' flag )
    2dup 2 - + c@ $80 and IF  msg-dec-sig?  ELSE  msg-sig?  THEN ;

: replace-sig { addrsig usig addrmsg umsg -- }
    addrsig usig addrmsg umsg usig - [: type type ;] $tmp

    2dup msg-dec?-sig? !!sig!! 2drop addrmsg umsg smove ;
: new-otrsig ( addr u flag -- addrsig usig )
    >r 2dup startdate@ old>otr
    predate-key keccak# c:key@ c:key# smove
    [: sktmp pkmod sk@ drop >modkey .encsign-rest ;]
    ['] .sig r@ select $tmp
    2dup + 2 - r> swap orc!
    ( 2dup dump ) 1 64s /string ;

:noname { sig u' addr u -- }
    u' 64'+ u =  u sigsize# = and IF
	last# >r last# $@ >group
	addr u startdate@ 64dup date>i >r 64#1 64+ date>i' r>
	2dup = IF  ."  [otrified] "  addr u startdate@ .ticks  THEN
	U+DO