packages feed

credential-store 0.1.1 → 0.1.2

raw patch · 5 files changed

+19/−16 lines, 5 filesdep ~Win32dep ~cryptonitePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: Win32, cryptonite

API changes (from Hackage documentation)

Files

README.md view
@@ -1,2 +1,13 @@ # credential-store Windows and Linux credentials storage++Cross-platform library to access system-specific credential store.++Uses Windows CredRead/CredWrite/CredDelete API on Windows, DBus SecretStore API with gnome-keyring or kwallet as backends on Unix. MacOS is not supported yet.++Example usage:++    withCredentialStore $ \store -> do+        putCredential store credentialName credentialValue+        v <- getCredential store credentialName+        deleteCredential store credentialName
credential-store.cabal view
@@ -1,5 +1,5 @@ name:                credential-store-version:             0.1.1+version:             0.1.2 synopsis:            Library to access secure credential storage providers description:   Cross-platform library for storing secrets.@@ -22,12 +22,12 @@   build-depends:       base >= 4.7 && < 5                      , bytestring                      , containers-                     , cryptonite+                     , cryptonite >= 0.7                      , memory                      , safe-exceptions   if os(windows)     cpp-options:       -DWINBUILD-    build-depends:     Win32+    build-depends:     Win32 >= 2.5.0.0     other-modules:     System.CredentialStore.WinTypes                        System.CredentialStore.Windows   else
src/System/CredentialStore.hs view
@@ -2,14 +2,14 @@ {-| Cross-platform library to access system-specific credential store. -Uses Windows CredRead/CredWrite/CredDelete API on Windows,+Uses Windows CredRead\/CredWrite\/CredDelete API on Windows, DBus Secret Store API with gnome-keyring or kwallet as backends on Unix. MacOS is not supported yet.  Example usage:  @-withCredentialStore $ \store -> do+withCredentialStore $ \\store -> do     putCredential store credentialName credentialValue     v <- getCredential store credentialName     deleteCredential store credentialName
src/System/CredentialStore/DBusSecretService.hs view
@@ -15,11 +15,11 @@ import Crypto.Error import Crypto.Hash import Crypto.KDF.HKDF+import Crypto.Number.Serialize import Crypto.PubKey.DH import Crypto.Random import DBus import DBus.Client-import Data.Bits import Data.ByteArray import qualified Data.ByteString as BS import qualified Data.Map.Strict as M@@ -204,12 +204,7 @@     return (convert encrypted, ivbytes)  dumpKey :: PublicNumber -> BS.ByteString-dumpKey (PublicNumber key) = BS.reverse $ BS.unfoldr step key-  where-    step 0 = Nothing-    step i = Just (fromIntegral i, i `shiftR` 8)+dumpKey (PublicNumber key) = i2osp key  readKey :: BS.ByteString -> PublicNumber-readKey = PublicNumber . BS.foldl' step 0-  where-    step i b = i `shiftL` 8 .|. fromIntegral b+readKey = PublicNumber . os2ip
src/System/CredentialStore/WinTypes.hsc view
@@ -89,9 +89,6 @@ eRROR_NOT_FOUND :: ErrCode eRROR_NOT_FOUND = #const ERROR_NOT_FOUND -eRROR_INSUFFICIENT_BUFFER :: ErrCode-eRROR_INSUFFICIENT_BUFFER = #const ERROR_INSUFFICIENT_BUFFER- foreign import ccall unsafe "CredReadW" c_CredRead :: LPCTSTR -> DWORD -> DWORD -> Ptr (Ptr CREDENTIAL) -> IO BOOL  foreign import ccall unsafe "CredWriteW" c_CredWrite :: Ptr CREDENTIAL -> DWORD -> IO BOOL