File tree 3 files changed +26
-0
lines changed
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,17 @@ wrap [
142
142
]
143
143
"RSA PUBLIC KEY" [ return init-rsa-public-key data ]
144
144
"RSA PRIVATE KEY" [ return init-rsa-private-key data ]
145
+ "DH PARAMETERS" [
146
+ parse data [
147
+ 'SEQUENCE into [
148
+ 'INTEGER set p binary!
149
+ 'INTEGER set g binary!
150
+ ] (
151
+ return dh-init :g :p
152
+ )
153
+ ]
154
+
155
+ ]
145
156
]
146
157
none ; no success!
147
158
]
Original file line number Diff line number Diff line change @@ -224,6 +224,13 @@ sY29ouezv4Xz2PuMch5VGPP+CDqzCM4loWgV
224
224
--test-- "Init RSA key from file"
225
225
--assert handle? try [key: decode 'ssh-key read %units/files/rebol-public.ppk ]
226
226
rsa key none ; release it, as it is not GCed yet.
227
+
228
+ --test-- "Init public DH params from file"
229
+ --assert all [
230
+ handle? key: load %units/files/dhparam2048.key
231
+ 'dhm = query /mode key 'type
232
+ dh/release key
233
+ ]
227
234
===end-group===
228
235
229
236
===start-group=== "PPK codec"
Original file line number Diff line number Diff line change
1
+ -----BEGIN DH PARAMETERS-----
2
+ MIIBCAKCAQEAhR9gLa+RbIUY+u3qZHRwTfw4Q0VoJOv4FK3et9HQNSvZmmUqzcG/
3
+ t3v3TPD3NRsLTh7hrvQcWFR7dsgqLFjqrMvthcRXsLYOxsT9ERL3nMPloEItggRG
4
+ 9hk3RzGFYb9nx56RXDJ3Nh+/pYfG3Ab+3gt+V/7Ato+Ws61lHVQmQ1cBUvkdjy4i
5
+ uIm5vr91VVgMc8Bi9PvhsPhjU4f9LQIykiY7+nsJpbgNdlU55Db8/Atc3PnL11z/
6
+ xXjmnj1QBjWymkz5LDEMJYCkMcFGwiToL6+jYjAkG1GpU6Jt4C5Z00E4LERy/jCi
7
+ geGoH8yNQvldeqw5lTcNpaWWB2+ROqUj0wIBAg==
8
+ -----END DH PARAMETERS-----
You can’t perform that action at this time.
0 commit comments