Check-in [d1e3e9abdf]
Not logged in

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

Overview
Comment:Work on creating a new nick through the GUI
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d1e3e9abdf7533f0306a882eb0302a9abbec2347
User & Date: bernd 2019-01-04 23:16:57
Context
2019-01-05
16:29
create new ID works check-in: d38bac7a07 user: bernd tags: trunk
2019-01-04
23:16
Work on creating a new nick through the GUI check-in: d1e3e9abdf user: bernd tags: trunk
22:07
Minor changes due to recent MINOS2 changes check-in: ebf099f318 user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to gui.fs.

123
124
125
126
127
128
129


130
131
132
133
134

135



136
137
138
139
140
141
142
143

144
145
146



147
148
149
150
151
152




















153











154
155
156
157
158
159
160
...
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
	>o action-of animate ['] err-fade = flag or to flag
	o anims[] >stack o>
    LOOP  flag ;

forward show-nicks
forward gui-msgs
0 Value title-vp



Variable nick$

: nick-done ( max span addr pos -- max span addr pos flag )
    over 3 pick nick$ $! true ;





: pw-done ( max span addr pos -- max span addr pos flag )
    err-fade? IF  false  EXIT  THEN
    over 3 pick >passphrase +key
    read-keys secret-keys# 0= IF
	\ ." Wrong passphrase" cr
	1 tries# +! tries# @ 0 <# #s #> pw-num >o to text$ o>
	keys sec[]free
	drop nip 0 tuck false

	1e o ['] shake-lr >animate
	1 tries# @ lshift s>f f2/ pw-err ['] err-fade >animate
    ELSE



	0 >o 0 secret-key init-client >raw-key
	read-chatgroups announce-me
	o>
	\ ." Right passphrase" cr
	show-nicks
	drop nip 0 tuck true




















    THEN ;












: 20%bt ( o -- o ) >o font-size# 20% f* to bordert o o> ;
: 25%b ( o -- o ) >o font-size# 25% f* to border o o> ;
: 25%bv ( o -- o ) >o font-size# 25% f* fdup to border fnegate to borderv o o> ;
: 40%b ( o -- o ) >o font-size# 40% f* to border o o> ;

\ password frame
................................................................................
		    glue*l }}glue
		    glue-sleft }}glue
		}}h
		blackish
		{{
		    {{
			pw-text-col# to x-color
			"" }}pw dup Value pw-field
			25%b >o config:passmode# @ to pw-mode o o>
			glue*lll }}glue
		    }}h
		    pw-field ' pw-done edit[]
		    {{
			\large \sans whitish "­čĹü" }}text
			\normal \bold show-sign-color# to x-color "´╝╝" }}text dup value show-pw-sign /center blackish







>
>




|
>

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







 







|







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142





143

144
145
146

147
148
149
150
151
152

153

154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
...
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
	>o action-of animate ['] err-fade = flag or to flag
	o anims[] >stack o>
    LOOP  flag ;

forward show-nicks
forward gui-msgs
0 Value title-vp
0 Value pw-field
0 Value nick-pw

Variable nick$

: nick-done ( max span addr pos -- max span addr pos flag )
    over 3 pick nick$ $!
    pw-field engage 1 to nick-pw  true ;

: clear-edit ( max span addr pos -- max 0 addr 0 true )
    drop nip 0 tuck true ;

: do-shake ( max span addr pos -- max span addr pos flag )





    keys sec[]free

    clear-edit invert
    1e o ['] shake-lr >animate
    1 tries# @ lshift s>f f2/ pw-err ['] err-fade >animate ;


: right-phrase ( max span addr pos -- max span addr pos flag )
    \ ." Right passphrase" cr
    0 >o 0 secret-key init-client >raw-key
    read-chatgroups announce-me
    o>

    show-nicks clear-edit ;


: pw-done ( max span addr pos -- max span addr pos flag )
    case nick-pw
	1 of
	    1 +to nick-pw
	    over 3 pick >passphrase +key
	    create-new-id /hflip
	    phrase-again /flop
	    clear-edit invert
	endof
	2 of
	    over 3 pick >passphrase lastkey@ str= IF
		." Create nick " nick$ $. ."  with passphrase (hashed) " lastkey@ 85type cr
		nick$ $@ new-key,
		right-phrase
	    ELSE
		1 to nick-pw
		create-new-id /flop
		phrase-again /hflip
		1 tries# ! do-shake
	    THEN
	endof
	err-fade? IF  false  EXIT  THEN
	over 3 pick >passphrase +key
	read-keys secret-keys# 0= IF
	    \ ." Wrong passphrase" cr
	    1 tries# +! tries# @ 0 <# #s #> pw-num >o to text$ o>
	    do-shake
	ELSE
	    right-phrase
	THEN
    endcase ;

: 20%bt ( o -- o ) >o font-size# 20% f* to bordert o o> ;
: 25%b ( o -- o ) >o font-size# 25% f* to border o o> ;
: 25%bv ( o -- o ) >o font-size# 25% f* fdup to border fnegate to borderv o o> ;
: 40%b ( o -- o ) >o font-size# 40% f* to border o o> ;

\ password frame
................................................................................
		    glue*l }}glue
		    glue-sleft }}glue
		}}h
		blackish
		{{
		    {{
			pw-text-col# to x-color
			"" }}pw dup to pw-field
			25%b >o config:passmode# @ to pw-mode o o>
			glue*lll }}glue
		    }}h
		    pw-field ' pw-done edit[]
		    {{
			\large \sans whitish "­čĹü" }}text
			\normal \bold show-sign-color# to x-color "´╝╝" }}text dup value show-pw-sign /center blackish

Changes to keys.fs.

1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103



1104
1105
1106
1107
1108
1109
1110
: +dhtroot ( -- )
    defaultkey @ >storekey !
    import#manual import-type !  64#-1 key-read-offset 64!
    dhtroot.n2o $@ do-key
    last-key >o "\x02" ke-groups $! perm%dhtroot ke-mask ! o>
    import#new import-type ! ;

: new-key ( nickaddr u -- )
    ?check-rng \ before generating a key, check the rng for health
    +newphrase key>default
    key#user +gen-keys
    secret-keys# 1- secret-key >raw-key  lastkey@ drop defaultkey !
    out-me +dhtroot save-keys ;




\ revokation

4 datesize# + keysize 9 * + Constant revsize#

Variable revtoken








|

|



>
>
>







1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
: +dhtroot ( -- )
    defaultkey @ >storekey !
    import#manual import-type !  64#-1 key-read-offset 64!
    dhtroot.n2o $@ do-key
    last-key >o "\x02" ke-groups $! perm%dhtroot ke-mask ! o>
    import#new import-type ! ;

: new-key, ( nickaddr u -- )
    ?check-rng \ before generating a key, check the rng for health
    key>default
    key#user +gen-keys
    secret-keys# 1- secret-key >raw-key  lastkey@ drop defaultkey !
    out-me +dhtroot save-keys ;

: new-key ( nickaddr u -- )
    +newphrase new-key, ;

\ revokation

4 datesize# + keysize 9 * + Constant revsize#

Variable revtoken