Skip to content

Commit 8e88df5

Browse files
committed
Release v0.1.0
1 parent 21c29db commit 8e88df5

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
.vscode

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Git on linux has basically 3 options to store credentials.
1111
- [git-credential-store](https://git-scm.com/docs/gitcredentials): stores credentials unencrypted on a filesystem, so anybody with access to the file can read them.
1212
- libsecret based implementations (like this [one](https://github.com/shugo/git-credential-gnomekeyring)): These store credentials encrypted, but bring a full secret management solution and require workarounds without a graphical session ([see here](https://superuser.com/questions/141036/use-of-gnome-keyring-daemon-without-x)).
1313

14-
With GitHub's move to personal access tokens, I felt the need for a lightweight enrypting solution.
15-
Nicator works like git-credential-store but it encrypts the saved credentials.
16-
Therefore it should be decently secure.
14+
With GitHub's move to personal access tokens, I felt the need for a lightweight encrypting solution.
15+
Nicator works like git-credential-store but it encrypts the saved credentials, so it protects against the credentials file getting stolen.
16+
__It does not do anything about malicious code being executed or its sockets and process memory getting read, especially after unlocking.__
1717
Most of nicators dependencies are statically linked, so it does not require any uncommon dependencies.
1818

1919
## Usage
@@ -23,7 +23,7 @@ Most of nicators dependencies are statically linked, so it does not require any
2323
4. Execute `nicator unlock` to enable storing and fetching credentials.
2424
5. Execute `nicator lock` to disable storing and fetching credentials.
2525

26-
`nicator unlock -t SECONDS` allows specifying a timeout after which the credentials become inaccessable. It defaults to 1 hour. It might be handy to create a shell alias to change it consitently. The `-c` and `-s` flags can be used to change the path used for the credentials file and socket file respectively. These should not leak any data as long these files are only readable and writeable by the the file's owner, which nicator takes care of.
26+
`nicator unlock -t SECONDS` allows specifying a timeout after which the credentials become inaccessible. It defaults to 1 hour. It might be handy to create a shell alias to change it consistently. The `-c` and `-s` flags can be used to change the path used for the credentials file and socket file respectively. These should not leak any data as long these files are only readable and writeable by the the file's owner, which nicator takes care of.
2727

2828
## How nicator works
2929
Unlocking will automatically launch a nicator server/daemon process listening on a unix socket with appropriate permissions (found in `/tmp`), which keeps the password in-memory.
@@ -35,3 +35,4 @@ The passphrase is hashed using Argon2id.
3535
## Security considerations
3636
- You should trust the root user on your system.
3737
- When hibernating your nicator password may be written to the disk if a nicator server is still running
38+
- Malicious code may act like a valid the nicator client and read credentials from the unix socket after the credential store is unlocked

release-notes/v0.1.0.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Initial release

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn perform_init(options: &ProgramOptions) -> Exit {
185185

186186
fn perform_lock(options: &ProgramOptions) -> Exit {
187187
with_client(options, |client| {
188-
client.lock().expect("Failed to lock the nicator store")
188+
client.lock().expect("Failed to lock the nicator store");
189189
})
190190
}
191191

@@ -211,7 +211,7 @@ fn perform_unlock(options: &ProgramOptions) -> Exit {
211211
);
212212
client
213213
.unlock(passphrase, store_path, options.timeout)
214-
.expect("Failed to unlock the nicator store.")
214+
.expect("Failed to unlock the nicator store.");
215215
}),
216216
Err(err) => {
217217
eprintln!(
@@ -233,7 +233,7 @@ fn perform_store(options: &ProgramOptions) -> Exit {
233233
with_client(options, |client| {
234234
client
235235
.store(credential)
236-
.expect("Failed to store the credential.")
236+
.expect("Failed to store the credential.");
237237
})
238238
}
239239

@@ -265,7 +265,7 @@ fn perform_erase(options: &ProgramOptions) -> Exit {
265265
with_client(options, |client| {
266266
client
267267
.erase(credential)
268-
.expect("Failed to erase the credential.")
268+
.expect("Failed to erase the credential.");
269269
})
270270
}
271271

src/store.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl Store {
102102
let mut cipher = ChaCha20Poly1305::new(key);
103103
let nonce = Nonce::from_slice(&nonce_data);
104104
let plain = cipher
105-
.decrypt(&nonce, store_data.as_slice())
105+
.decrypt(nonce, store_data.as_slice())
106106
.map_err(|_| crate::Error::Crypto)?;
107107
let store = bincode::deserialize(&plain)?;
108108
Ok(store)

0 commit comments

Comments
 (0)