Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
412c8312b0 | ||
|
|
012486c045 | ||
|
|
cdff8c8917 | ||
|
|
f305822ae1 | ||
|
|
7cf0b34078 | ||
|
|
191be38fbe | ||
|
|
f2ae7bca76 | ||
|
|
3d8b41c5b6 | ||
|
|
60f40262f7 | ||
|
|
32c9241a2e | ||
|
|
29ca8a64bf |
11
ChangeLog.md
11
ChangeLog.md
@@ -1,3 +1,12 @@
|
||||
# Changelog for passman
|
||||
|
||||
## Unreleased changes
|
||||
## 0.2
|
||||
|
||||
- implemented manual saving
|
||||
- added a warning when changing master password
|
||||
- some code cleanup as suggested by [Stephen Paul Weber](https://github.com/singpolyma)
|
||||
|
||||
## 0.1.1
|
||||
|
||||
- corrected a bug that was causing the pwGenerate function to hang occasionally.
|
||||
- this may cause some passwords to be generated differently
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# passman
|
||||
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -38,7 +38,7 @@ This package uses [Haskell Stack](https://haskellstack.org). Please
|
||||
refer to [their
|
||||
website](https://docs.haskellstack.org/en/stable/README/#how-to-install)
|
||||
for instructions on installing Haskell Stack. Once you have done
|
||||
this, you can simply enterg the command `stack install passman` in the
|
||||
this, you can simply enter the command `stack install passman` in the
|
||||
terminal to install passman.
|
||||
|
||||
## GitHub
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -63,6 +63,7 @@ mainMenu =
|
||||
[ ( "add a password", addPassword )
|
||||
, ( "view/edit a password", viewEditMenu )
|
||||
, ( "change master password", changeMasterPass )
|
||||
, ( "save manually", save >> mainMenu )
|
||||
, ( "lock session", lockSession )
|
||||
, ( "quit", quit )
|
||||
]
|
||||
@@ -93,9 +94,13 @@ viewEditMenu = menu "View/Edit Password"
|
||||
|
||||
changeMasterPass :: S.StateT Status IO ()
|
||||
changeMasterPass = do
|
||||
req (confirm $
|
||||
"\nWARNING: Changing your master password will change all of your saved passwords.\n" ++
|
||||
"Are you sure you would like to proceed?") >>= flip when
|
||||
(do
|
||||
oldP <- S.gets $ view masterPass
|
||||
newP <- req $ reqDefault getMasterPass oldP
|
||||
S.modify $ set masterPass newP
|
||||
S.modify $ set masterPass newP)
|
||||
mainMenu
|
||||
|
||||
lockSession :: S.StateT Status IO ()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
name: passman
|
||||
version: 0.1
|
||||
version: 0.2
|
||||
github: "jlamothe/passman"
|
||||
license: LGPL-3
|
||||
author: "Jonathan Lamothe"
|
||||
maintainer: "jlamothe1980@gmail.com"
|
||||
copyright: "(C) 2018 Jonathan Lamothe"
|
||||
copyright: "(C) 2018, 2019 Jonathan Lamothe"
|
||||
|
||||
extra-source-files:
|
||||
- README.md
|
||||
@@ -30,6 +30,7 @@ dependencies:
|
||||
library:
|
||||
source-dirs: src
|
||||
dependencies:
|
||||
- base16-bytestring
|
||||
- base64-bytestring
|
||||
- SHA
|
||||
- text
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Module: Password
|
||||
Description: a simple password manager
|
||||
Copyright: (C) 2018 Jonathan Lamothe
|
||||
Copyright: (C) 2018, 2019 Jonathan Lamothe
|
||||
License: LGPLv3 (or later)
|
||||
Maintainer: jlamothe1980@gmail.com
|
||||
|
||||
@@ -59,6 +59,7 @@ import Data.Aeson
|
||||
, (.=)
|
||||
)
|
||||
import qualified Data.ByteString.Lazy as B
|
||||
import qualified Data.ByteString.Base16.Lazy as B16
|
||||
import qualified Data.ByteString.Base64.Lazy as B64
|
||||
import Data.Char (isUpper, isLower, isDigit, isAlphaNum, toLower)
|
||||
import Data.Digest.Pure.SHA
|
||||
@@ -322,26 +323,24 @@ isSpecial :: Char -> Bool
|
||||
isSpecial = not . isAlphaNum
|
||||
|
||||
mkPass :: String -> PWPolicy -> String
|
||||
mkPass (x:xs) p = let p' = nextPolicy x p in
|
||||
if p^.pwLength <= 0
|
||||
mkPass [] _ = "" -- this should never happen
|
||||
mkPass (x:xs) p = if p^.pwLength <= 0
|
||||
then ""
|
||||
else if validatePWPolicy p'
|
||||
else let p' = nextPolicy x p in
|
||||
if validatePWPolicy p'
|
||||
then x : mkPass xs p'
|
||||
else mkPass xs p
|
||||
|
||||
mkPool :: B.ByteString -> String
|
||||
mkPool = toB64 . raw where
|
||||
raw x = let x' = mkHash x in
|
||||
x' `B.append` raw x
|
||||
x' `B.append` raw x'
|
||||
|
||||
mkSeed :: String -> PWData -> B.ByteString
|
||||
mkSeed pw d = toUTF8 pw `B.append` (d^.pwSalt)
|
||||
|
||||
mkHash :: B.ByteString -> B.ByteString
|
||||
mkHash = raw . show . sha256 where
|
||||
raw (x:y:xs) = read ("0x" ++ [x] ++ [y]) `B.cons` raw xs
|
||||
raw [_] = error "odd number of hex digits in hash"
|
||||
raw "" = B.empty
|
||||
mkHash = fst . B16.decode . encodeUtf8 . T.pack . show . sha256
|
||||
|
||||
nextPolicy :: Char -> PWPolicy -> PWPolicy
|
||||
nextPolicy x p = over pwLength pred $
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-
|
||||
|
||||
passman
|
||||
Copyright (C) 2018 Jonathan Lamothe
|
||||
Copyright (C) 2018, 2019 Jonathan Lamothe
|
||||
<jlamothe1980@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
Reference in New Issue
Block a user