radius 0.4.0.0 → 0.5.0.0
raw patch · 2 files changed
+4/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Network.RADIUS.Encoding: authenticatorLength :: Int64
- Network.RADIUS.Encoding: decodeAttributes :: [PacketAttribute] -> Get [PacketAttribute]
- Network.RADIUS.Encoding: decodeHeader :: Get Header
- Network.RADIUS.Encoding: decodePacket :: Header -> Get Packet
- Network.RADIUS.Encoding: encodeAttributes :: [PacketAttribute] -> ByteString
- Network.RADIUS.Encoding: getAttribute :: Word8 -> Get PacketAttribute
- Network.RADIUS.Encoding: getAttributeStr :: Get ByteString
- Network.RADIUS.Encoding: getAttributeValue :: (Binary a) => Get a
- Network.RADIUS.Encoding: getEnum :: (Enum a) => Get a
- Network.RADIUS.Encoding: hashMD5 :: ByteString -> ByteString
- Network.RADIUS.Encoding: putAttribute :: (Binary a) => Word8 -> a -> Put
- Network.RADIUS.Encoding: putAttributeStr :: Word8 -> ByteString -> Put
- Network.RADIUS.Encoding: putEnum :: (Enum a) => a -> Put
Files
- radius.cabal +1/−1
- src/Network/RADIUS/Encoding.hs +3/−1
radius.cabal view
@@ -1,5 +1,5 @@ name: radius-version: 0.4.0.0+version: 0.5.0.0 synopsis: Remote Authentication Dial In User Service (RADIUS) description: This module provides types and on the wire de/coding of RADIUS packets as per RFC2865 homepage: https://github.com/erickg/radius#readme
src/Network/RADIUS/Encoding.hs view
@@ -13,7 +13,7 @@ -} -module Network.RADIUS.Encoding where+module Network.RADIUS.Encoding (radiusHeaderSize, sign) where import Control.Monad (when) import Data.Binary (Binary(..), encode)@@ -82,6 +82,7 @@ return Packet { getHeader = header, getPacketAttributes = attributes } +-- | Add authenticator field to a RADIUS packet using the specified secret sign :: ByteString -> ByteString -> ByteString sign packet secret = let authenticator = hashMD5 $ packet `append` secret@@ -89,6 +90,7 @@ attributes = B.drop (fromIntegral radiusHeaderSize) packet in prologue `append` authenticator `append` attributes +-- | Used internally to calculate authenticator field hashMD5 :: ByteString -> ByteString hashMD5 = B.fromStrict . convert . (hashlazy :: ByteString -> Digest MD5)