summaryrefslogtreecommitdiff
path: root/lib/Transforms.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms.hs')
-rw-r--r--lib/Transforms.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms.hs b/lib/Transforms.hs
index 8a1da73..8adf6af 100644
--- a/lib/Transforms.hs
+++ b/lib/Transforms.hs
@@ -36,7 +36,7 @@ import Data.ASN1.Types (toASN1, ASN1Object, fromASN1, ASN1(Start, End, IntVal),
36 36
37import Data.ASN1.Encoding ( encodeASN1 ) 37import Data.ASN1.Encoding ( encodeASN1 )
38import qualified Data.Text as T ( Text, unpack, pack, 38import qualified Data.Text as T ( Text, unpack, pack,
39 strip, reverse, drop, break, dropAround, length ) 39 strip, reverse, drop, break, dropAround, length, breakOn )
40import Data.Text.Encoding ( encodeUtf8 ) 40import Data.Text.Encoding ( encodeUtf8 )
41import Data.Bits ((.|.), (.&.), Bits) 41import Data.Bits ((.|.), (.&.), Bits)
42 42
@@ -768,9 +768,11 @@ parseUID str = UserIDRecord {
768 (T.strip-> realname, T.dropAround isBracket-> email) 768 (T.strip-> realname, T.dropAround isBracket-> email)
769 = T.break (=='<') text 769 = T.break (=='<') text
770 (user, T.drop 1-> hostname) = T.break (=='@') email 770 (user, T.drop 1-> hostname) = T.break (=='@') email
771 ( T.reverse -> topdomain, 771 (topdomain, subdomain) =
772 T.reverse . T.drop 1 -> subdomain) 772 case T.breakOn ".ssh-rsa.cryptonomic.net" hostname of
773 = T.break (=='.') . T.reverse $ hostname 773 (s,".ssh-rsa.cryptonomic.net") -> ("ssh-rsa.cryptonomic.net", s)
774 _ -> (T.reverse *** T.reverse . T.drop 1)
775 $ T.break (=='.') . T.reverse $ hostname
774 776
775selfAuthenticated :: OriginMapped Packet -> KeyData -> UidString -> Bool 777selfAuthenticated :: OriginMapped Packet -> KeyData -> UidString -> Bool
776selfAuthenticated k kd (UidString str) = 778selfAuthenticated k kd (UidString str) =