[companion] Remove old code

Signed-off-by: Armin Friedl <dev@friedl.net>
This commit is contained in:
Armin Friedl 2019-11-29 19:05:35 +01:00
parent 8427a6ad53
commit 83999d7680
Signed by: armin
GPG key ID: 48C726EEE7FBCBC8
2 changed files with 7 additions and 25 deletions

View file

@ -2,6 +2,7 @@
** TODO Add a license
** TODO Better communication protocol
** TODO Add tests
** TODO Readme
* Coffer Server
** TODO Add secrets on-the-fly
** TODO Store secrets in secure memory
@ -14,8 +15,10 @@
** TODO Send key requests encrypted/signed
* Coffer Companion
** TODO Add Subcommands
- [ ] Generate master key
- [X] Generate master key
- [ ] Generate client key
- [ ] Encrypt/Decrypt secrets with master key
- [ ] Encrypt/Decrypt key request with client key
- [X] Encrypt secrets with master key
- [ ] Decrypt secrets with master key
- [ ] Encrypt key request with client key
- [ ] Decrypt key request with client key
- [ ] Generate trampolin sh from dockerfile

View file

@ -1,6 +1,3 @@
use std::error::Error;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
use structopt::StructOpt;
@ -23,29 +20,11 @@ enum Args {
}
}
fn main() -> Result<(), Box<dyn Error>> {
fn main() {
let args: Args = Args::from_args();
match args {
Args::Generate {out} => generate::generate_key(out),
Args::Encrypt {yaml, out, masterkey} => encrypt::generate_encrypted_secrets(yaml, out, masterkey)
}
let secreta = "ABC".to_owned();
let mut f = File::create("./keyreq_a.cbor")?;
let buf = serde_cbor::to_vec(&secreta)?;
f.write(&buf.len().to_be_bytes())?;
f.write(&buf)?;
let secretb = "XYZ".to_owned();
let mut f = File::create("./keyreq_b.cbor")?;
let buf = serde_cbor::to_vec(&secretb)?;
f.write(&buf.len().to_be_bytes())?;
f.write(&buf)?;
let secs = vec!["ABC", "XYZ"];
let f = File::create("./secreq.yaml")?;
serde_yaml::to_writer(f, &secs)?;
Ok(())
}