Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean what is now useless for ptt #48

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions lib/authentication.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,20 @@ let decode_plain_authentication hash ?stamp t v =
take_till is_zero >>= fun v0 ->
char '\000' *> take_till is_zero >>= fun v1 ->
char '\000' *> available >>= take >>= fun v2 -> return (v0, v1, v2) in
match
( stamp
, Base64.decode ~pad:false (* XXX(dinosaure): not really sure. *) v
>>= (R.reword_error (fun _ -> `Msg "Invalid input")
<.> Angstrom.parse_string ~consume:All parser) )
with
let payload =
Base64.decode ~pad:false (* XXX(dinosaure): not really sure. *) v
>>= (R.reword_error (fun _ -> `Msg "Invalid input") <.> Angstrom.parse_string ~consume:All parser) in
match stamp, payload with
| Some stamp, Ok (v0, v1, v2) ->
if Eqaf.equal stamp v0 then
match Angstrom.parse_string ~consume:All Emile.Parser.local_part v1 with
| Ok username -> authenticate hash username v2 t
| Error _ -> Lwt.return (R.error_msgf "Invalid username: %S" v1)
else Lwt.return (R.error_msgf "Invalid stamp")
| None, Ok ("", v1, v2) -> (
match Angstrom.parse_string ~consume:All Emile.Parser.local_part v1 with
| None, Ok ("", v1, v2) ->
begin match Angstrom.parse_string ~consume:All Emile.Parser.local_part v1 with
| Ok username -> authenticate hash username v2 t
| Error _ -> Lwt.return (R.error_msgf "Invalid username: %S" v1))
| Error _ -> Lwt.return (R.error_msgf "Invalid username: %S" v1) end
| None, Ok (_, _, _) -> Lwt.return (R.error_msgf "Unexpected stamp")
| _, (Error _ as err) -> Lwt.return err

Expand Down
18 changes: 2 additions & 16 deletions lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
(library
(name ptt)
(public_name ptt)
(modules ptt authentication logic mechanism messaged
relay sigs sMTP sSMTP submission)
(modules ptt authentication logic mechanism messaged relay sMTP sSMTP submission)
(libraries ptt.common ptt.flow ptt.aggregate digestif mrmime colombe.emile domain-name dns sendmail.starttls
logs ipaddr)
(preprocess future_syntax))
Expand All @@ -41,14 +40,7 @@
(name ptt_server)
(public_name ptt.server)
(modules ptt_server)
(libraries lwt tls-mirage bigstringaf mirage-time mirage-flow tcpip mimic
ptt.rdwr ptt))

; (library
; (name ptt_transmit)
; (public_name ptt.transmit)
; (modules ptt_transmit)
; (libraries hxd.core hxd.string ptt.tuyau mirage-clock received))
(libraries lwt tls-mirage bigstringaf mirage-time mirage-flow tcpip mimic ptt))

(library
(name lipap)
Expand Down Expand Up @@ -85,9 +77,3 @@
(public_name ptt.spartacus)
(modules spartacus)
(libraries mirage-time mirage-clock mirage-random ptt ptt.map ptt.server spamtacus-mirage dns-client-mirage))

(library
(name rdwr)
(public_name ptt.rdwr)
(modules rdwr)
(libraries cstruct bigstringaf lwt rresult ke mirage-flow ptt))
24 changes: 0 additions & 24 deletions lib/lexicon.ml

This file was deleted.

1 change: 0 additions & 1 deletion lib/ptt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ module Relay = Relay
module Messaged = Messaged
module Authentication = Authentication
module Mechanism = Mechanism
module Sigs = Sigs
module Logic = Logic
171 changes: 0 additions & 171 deletions lib/ptt_transmit.ml

This file was deleted.

21 changes: 0 additions & 21 deletions lib/ptt_transmit.mli

This file was deleted.

47 changes: 0 additions & 47 deletions lib/rdwr.ml

This file was deleted.

60 changes: 0 additions & 60 deletions lib/sigs.ml

This file was deleted.

Loading
Loading