Check-in [528007f864]
Not logged in

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

Overview
Comment:Add dummies for future expansion of pubkey format
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 528007f8646ebcdafcf85fd091fd1e17b4d9b08b
User & Date: bernd 2019-04-30 22:23:38
Context
2019-05-02
14:57
Bump version number check-in: 1ef068a4dc user: bernd tags: trunk, 0.8.8-20190502
2019-04-30
22:23
Add dummies for future expansion of pubkey format check-in: 528007f864 user: bernd tags: trunk
2019-04-26
19:12
Fix for bugs Martin detected yesterday check-in: cfc7fe3d19 user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to classes.fs.

490
491
492
493
494
495
496











497
498
499
500
501
502
503
    field: ke-pets#    \ to avoid colissions, add a number here
    field: ke-prof     \ profile object
    field: ke-avatar   \ avatar object
    field: ke-chat     \ chat group for 1:1 chat with that person
    field: ke-selfsig
    field: ke-sigs[]
    field: ke-imports  \ bitmask of key import











    field: ke-storekey \ used to encrypt on storage
    field: ke-mask     \ permission mask
    field: ke-groups   \ permission groups
    64field: ke-offset \ offset in key file
    field: ke-pwlevel  \ password strength level
    field: ke-sksig    \ signature secret, computed, never stored
    0 +field ke-end







>
>
>
>
>
>
>
>
>
>
>







490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
    field: ke-pets#    \ to avoid colissions, add a number here
    field: ke-prof     \ profile object
    field: ke-avatar   \ avatar object
    field: ke-chat     \ chat group for 1:1 chat with that person
    field: ke-selfsig
    field: ke-sigs[]
    field: ke-imports  \ bitmask of key import
    field: ke-[]1
    field: ke-[]2
    field: ke-[]3
    field: ke-[]4
    field: ke-sec1
    field: ke-sec2
    64field: ke-#1
    64field: ke-#2
    64field: ke-#3
    64field: ke-#4
\ other fields
    field: ke-storekey \ used to encrypt on storage
    field: ke-mask     \ permission mask
    field: ke-groups   \ permission groups
    64field: ke-offset \ offset in key file
    field: ke-pwlevel  \ password strength level
    field: ke-sksig    \ signature secret, computed, never stored
    0 +field ke-end

Changes to debugging.fs.

6
7
8
9
10
11
12

13
14
15

16
17
18
19
20
21
22
	@ IF  ['] noop assert-canary
	ELSE  postpone (  THEN ;
    : )else(  ]] ) ( [[ ; immediate \ )
[THEN]

: nodebug: ['] ( Alias immediate ;


:noname ( ... -- ... )
    depth IF  ...  THEN
    fdepth IF  cr "F:" type f.s  THEN ; is printdebugdata


require xtype.fs
require base64.fs
require base85.fs

: .nnb ( addr n -- )  85type ;
: .64b ( addr -- ) 64 .nnb ;







>
|
|
|
>







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
	@ IF  ['] noop assert-canary
	ELSE  postpone (  THEN ;
    : )else(  ]] ) ( [[ ; immediate \ )
[THEN]

: nodebug: ['] ( Alias immediate ;

action-of .s. ' . = [IF]
    :noname ( ... -- ... )
	depth IF  ...  THEN
	fdepth IF  cr "F:" type f.s  THEN ; is printdebugdata
[THEN]

require xtype.fs
require base64.fs
require base85.fs

: .nnb ( addr n -- )  85type ;
: .64b ( addr -- ) 64 .nnb ;

Changes to keys.fs.

689
690
691
692
693
694
695
696
697












698
699
700
701
702
703
704
...
802
803
804
805
806
807
808

















809
810
811
812
813
814

815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
    pkrev keysize2 erase  ke-rsk sec! ;
+net2o: keypet ( $:string -- )  !!unsigned?  $>
    new-pet? IF
	ke-pets[] $+[]! pet!  EXIT
    THEN  2drop ;
+net2o: walletkey ( $:seed -- ) !!unsigned?  $>
    ke-wallet sec! ;
+net2o: avatar ( $:string -- ) !!signed?   8 !!>order? $> ke-avatar $! ;
    \g key profile (hash of a resource)












}scope

key-entry-table $save

' context-table is gen-table

: key:nest-sig ( addr u -- addr u' flag )
................................................................................
    ke-imports @ ulit, keyimport
    ke-mask @  ke-groups $@len IF
	ke-groups $@ 2dup $, keygroups
	groups>mask invert and  THEN
    ?dup-IF  ulit, keymask  THEN
    ke-pets[] [: $, keypet ;] $[]map
    ke-storekey @ >storekey ! ;

















previous

: pack-pubkey ( o:key -- )
    key:code
      key-version$ $, version
      pack-corekey

    end:key ;
: pack-outkey ( o:key -- )
    key:code
      "n2o" net2o-base:4cc,
      key-version$ $, version
      pack-signkey
    end:key ;
: pack-seckey ( o:key -- )
    key:code
      key-version$ $, version
      pack-corekey
      ke-sk sec@ sec$, privkey
      ke-rsk sec@ dup IF  sec$, rskkey  ELSE  2drop  THEN
      ke-wallet sec@ dup IF  sec$, walletkey  ELSE  2drop  THEN
    end:key ;
: keynick$ ( o:key -- addr u )
    \G get the annotations with signature
    ['] pack-core gen-cmd$ 2drop
    ke-selfsig $@ tmp$ $+! tmp$ $@ ;
: keypk2nick$ ( o:key -- addr u )
    \G get the annotations with signature







|
|
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>











|
|
|







689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
...
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
    pkrev keysize2 erase  ke-rsk sec! ;
+net2o: keypet ( $:string -- )  !!unsigned?  $>
    new-pet? IF
	ke-pets[] $+[]! pet!  EXIT
    THEN  2drop ;
+net2o: walletkey ( $:seed -- ) !!unsigned?  $>
    ke-wallet sec! ;
+net2o: avatar ( $:string -- )
    \g key avatar profile (hash of a resource)
    !!signed?   8 !!>order? $> ke-avatar $! ;
\ dummies that are retained even though we don't know what they are
+net2o: key-string1 ( $:string -- ) $> ke-[]1 $+[]! ;
+net2o: key-string2 ( $:string -- ) $> ke-[]2 $+[]! ;
+net2o: key-string3 ( $:string -- ) $> ke-[]3 $+[]! ;
+net2o: key-string4 ( $:string -- ) $> ke-[]4 $+[]! ;
+net2o: key-sec1 ( $:string -- ) $> ke-sec1 sec! ;
+net2o: key-sec2 ( $:string -- ) $> ke-sec2 sec! ;
+net2o: key-num1 ( 64n -- )  ke-#1 64! ;
+net2o: key-num2 ( 64n -- )  ke-#2 64! ;
+net2o: key-num3 ( 64n -- )  ke-#3 64! ;
+net2o: key-num4 ( 64n -- )  ke-#4 64! ;
}scope

key-entry-table $save

' context-table is gen-table

: key:nest-sig ( addr u -- addr u' flag )
................................................................................
    ke-imports @ ulit, keyimport
    ke-mask @  ke-groups $@len IF
	ke-groups $@ 2dup $, keygroups
	groups>mask invert and  THEN
    ?dup-IF  ulit, keymask  THEN
    ke-pets[] [: $, keypet ;] $[]map
    ke-storekey @ >storekey ! ;

: pack-coresec ( o:key -- )
    ke-sk sec@ sec$, privkey
    ke-rsk sec@ dup IF  sec$, rskkey  ELSE  2drop  THEN
    ke-wallet sec@ dup IF  sec$, walletkey  ELSE  2drop  THEN ;
: pack-coreextra ( o:key -- )
    ke-[]1 [: $, key-string1 ;] $[]map
    ke-[]2 [: $, key-string2 ;] $[]map
    ke-[]3 [: $, key-string3 ;] $[]map
    ke-[]4 [: $, key-string4 ;] $[]map
    ke-#1 64@ 64dup 64-0<> IF  lit, key-num1  ELSE  64drop  THEN
    ke-#2 64@ 64dup 64-0<> IF  lit, key-num2  ELSE  64drop  THEN
    ke-#3 64@ 64dup 64-0<> IF  lit, key-num3  ELSE  64drop  THEN
    ke-#4 64@ 64dup 64-0<> IF  lit, key-num4  ELSE  64drop  THEN ;
: pack-secextra ( o:key -- )
    ke-sec1 sec@ dup IF  sec$, key-sec1  ELSE  2drop  THEN
    ke-sec2 sec@ dup IF  sec$, key-sec2  ELSE  2drop  THEN ;
previous

: pack-pubkey ( o:key -- )
    key:code
      key-version$ $, version
      pack-corekey
      pack-coreextra
    end:key ;
: pack-outkey ( o:key -- )
    key:code
      "n2o" net2o-base:4cc,
      key-version$ $, version
      pack-signkey
    end:key ;
: pack-seckey ( o:key -- )
    key:code
      key-version$ $, version
      pack-corekey
      pack-coresec
      pack-coreextra
      pack-secextra
    end:key ;
: keynick$ ( o:key -- addr u )
    \G get the annotations with signature
    ['] pack-core gen-cmd$ 2drop
    ke-selfsig $@ tmp$ $+! tmp$ $@ ;
: keypk2nick$ ( o:key -- addr u )
    \G get the annotations with signature