Skip to content

Commit b74b714

Browse files
authored
Merge pull request #4 from pkgxdev/deprefixify
remove pkgx_ prefixes
2 parents 54983cf + 8d1fead commit b74b714

27 files changed

+62
-30
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
- uses: nosborn/[email protected]
7070
with:
7171
files: .
72+
ignore_files: ./README.md
7273

7374
test:
7475
name: Test

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[workspace]
2-
members = ["bpb-pkgx-cli", "pbp-pkgx-lib"]
3-
default-members = ["bpb-pkgx-cli"]
2+
members = ["bpb", "pbp"]
3+
default-members = ["bpb"]
44
resolver = "2"

README.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ do.
1313
## How to Install
1414

1515
```sh
16-
git clone https://github.com/pkgxdev/bpb-pkgx
17-
cd bpb-pkgx
18-
cargo install --path bpb-pkgx-cli
16+
git clone https://github.com/pkgxdev/bpb
17+
cd bpb
18+
cargo install --path bpb
1919
```
2020

2121
## How to Set Up
@@ -31,8 +31,8 @@ bpb init "withoutboats <[email protected]>"
3131
You can pass any string you want as your userid, but `"$NAME <$EMAIL>"` is the
3232
conventional standard for OpenPGP userids.
3333

34-
This will create a file at ~/.bpb_keys.toml. This file contains your public
35-
key.
34+
This will create a file at `~/.config/pkgx/bpb.toml`. This file contains your
35+
public key.
3636

3737
The private and public keys are output as JSON. This is the only time this
3838
tool will expose your private key publicly.
@@ -47,13 +47,43 @@ If you want to use it to sign git commits, you also need to inform git to call
4747
it instead of gpg. You can do this with this command:
4848

4949
```sh
50-
git config --global gpg.program bpb_pkgx
50+
git config --global gpg.program bpb
5151
```
5252

5353
You should also provide the public key to people who want to verify your
5454
commits. Personally, I just upload the public key to GitHub; you may have
5555
other requirements.
5656

57+
You can print your private key with:
58+
59+
```sh
60+
security find-generic-password -s "xyz.tea.BASE.bpb" -w
61+
# ^^ prompts for your login password
62+
```
63+
64+
65+
## Security Considerations
66+
67+
Our mechanism is pretty damn secure. But! We depend on:
68+
69+
> [!IMPORTANT]
70+
> * The strength of your login password.
71+
> * The strength of your iCloud password.
72+
73+
Someone desiring your GPG private key would need to steal your computer and
74+
then brute force your login password. So you should check how long that would
75+
take.
76+
77+
Your macOS Keychain *may* sync to iCloud. In which case your security also
78+
depends on the security of your iCloud password. Apple encrypt your keychain
79+
remotely but that is obviously decrypted by your iCloud password.
80+
81+
Realistically your iCloud password is more important as physical theft is an
82+
order of magnitude less likely than a remote attack. That can be mitigated by
83+
preventing iCloud Keychain sync but that’s pretty useful so maybe just have a
84+
secure iCloud password.
85+
86+
5787
## How it Replaces GPG
5888

5989
If this program receives a `-s` argument, it reads from stdin and then writes
@@ -64,6 +94,7 @@ This means that this program can be used to replace gpg as a signing tool, but
6494
it does not replace any other functionality. For example, if you want to
6595
verify the signatures on other peoples' git commits, it will shell out to gpg.
6696

97+
6798
## TODO
6899

69100
- [ ] Move keychain identifiers out to build variables in `main.rs`
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "bpb_pkgx"
2+
name = "bpb"
33
description = "boats's personal barricade - pkgx updates"
44
license = "MIT OR Apache-2.0"
55
version = "1.1.1"
@@ -16,8 +16,8 @@ serde = "1.0.215"
1616
hex = "0.3.2"
1717
failure = "0.1.1"
1818

19-
[dependencies.pbp_pkgx]
20-
path = "../pbp-pkgx-lib"
19+
[dependencies.pbp]
20+
path = "../pbp"
2121
features = ["dalek"]
2222

2323
[dependencies.ed25519-dalek]
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ impl KeyData {
2929
))
3030
}
3131

32-
pub fn sign(&self, data: &[u8]) -> Result<pbp_pkgx::PgpSig, Error> {
32+
pub fn sign(&self, data: &[u8]) -> Result<pbp::PgpSig, Error> {
3333
let timestamp = SystemTime::now()
3434
.duration_since(SystemTime::UNIX_EPOCH)?
3535
.as_secs();
36-
Ok(pbp_pkgx::PgpSig::from_dalek::<sha2::Sha256, sha2::Sha512>(
36+
Ok(pbp::PgpSig::from_dalek::<sha2::Sha256, sha2::Sha512>(
3737
&self.keypair,
3838
data,
3939
self.fingerprint(),
40-
pbp_pkgx::SigType::BinaryDocument,
40+
pbp::SigType::BinaryDocument,
4141
timestamp as u32,
4242
))
4343
}
4444

45-
pub fn fingerprint(&self) -> pbp_pkgx::Fingerprint {
45+
pub fn fingerprint(&self) -> pbp::Fingerprint {
4646
self.public().fingerprint()
4747
}
4848

49-
pub fn public(&self) -> pbp_pkgx::PgpKey {
50-
pbp_pkgx::PgpKey::from_dalek::<sha2::Sha256, sha2::Sha512>(
49+
pub fn public(&self) -> pbp::PgpKey {
50+
pbp::PgpKey::from_dalek::<sha2::Sha256, sha2::Sha512>(
5151
&self.keypair,
52-
pbp_pkgx::KeyFlags::SIGN | pbp_pkgx::KeyFlags::CERTIFY,
52+
pbp::KeyFlags::SIGN | pbp::KeyFlags::CERTIFY,
5353
self.timestamp as u32,
5454
&self.user_id,
5555
)

0 commit comments

Comments
 (0)