This commit is contained in:
Peter Harpending
2026-09-03 15:47:09 -07:00
parent 66364fce04
commit edf2030b34
10 changed files with 92 additions and 28 deletions
+9 -2
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env escript
%% authentication
%% needs:
%% - line parsing
%% - keyboard input
@@ -29,15 +30,21 @@ main_ii(PortNum) ->
spawn_link(fun() -> kbd_loop(Self) end),
j_loop(#js{tsock = TSock, nsock = NSock}).
server_pubkey() ->
<<116, 159, 91, 248, 138, 250, 73, 40, 231, 50, 81, 110, 137,
163, 44, 76, 48, 130, 225, 95, 168, 121, 93, 44, 148, 42, 180,
103, 11, 40, 168, 96>>.
noise_options() ->
% totally safe crypto
KP = enoise_keypair:new(dh25519),
[{noise, "Noise_NN_25519_ChaChaPoly_BLAKE2b"},
[{noise, "Noise_NK_25519_ChaChaPoly_BLAKE2b"},
{rs, server_pubkey()},
{e, KP}].
j_loop(JS = #js{rcv = Rcv, tsock = TSock, nsock = NSock}) ->
%ok = inet:setopts(TSock, [{active, once}]),
receive
{noise, NSock, Bytes} ->
NewRcv = <<Rcv/binary, Bytes/binary>>,
+1 -1
View File
@@ -39,7 +39,7 @@ noise_options() ->
148, 42, 180, 103, 11, 40, 168, 96>>,
KP = enoise_keypair:new(dh25519, Secret, Public),
[{noise, "Noise_NN_25519_ChaChaPoly_BLAKE2b"},
{e, KP}].
{s, KP}].
% pimp process startup
+11
View File
@@ -1,3 +1,14 @@
pubkey:
<<116, 159, 91, 248, 138, 250, 73, 40, 231, 50, 81, 110, 137, 163, 44, 76, 48, 130, 225, 95, 168, 121, 93, 44, 148, 42, 180, 103, 11, 40, 168, 96>>
rbx_tuple =
<<116,159,91,248,138,250,73,40,231,50,81,110,137,163,44,76,48,130,225,95,168,121,93,44,148,42,180,103,11,40,168,96>>
[{"127.0.0.1", 6969, "tcp", "Noise_NN_25519_ChaChaPoly_BLAKE2b", <<116,159,91,248,138,250,73,40,231,50,81,110,137,163,44,76,48,130,225,95,168,121,93,44,148,42,180,103,11,40,168,96>>, <<>>}]
{"127.0.0.1", 6970, "tcp", <<116,159,91,248,138,250,73,40,231,50,81,110,137,163,44,76,48,130,225,95,168,121,93,44,148,42,180,103,11,40,168,96>>, <<>>},
{"127.0.0.1", 6971, "tcp", <<116,159,91,248,138,250,73,40,231,50,81,110,137,163,44,76,48,130,225,95,168,121,93,44,148,42,180,103,11,40,168,96>>, <<>>}]
liquidate_hos([{HoPid, _HoRef} | Hos]) ->
p_logfln("liquidating ~tp", [HoPid]),