Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers encryption implementation #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Headers encryption implementation #33

wants to merge 1 commit into from

Conversation

denisbsu
Copy link
Contributor

No description provided.

struct EncryptedHeaders {
identity: Vec<u8>,
nonce: Vec<u8>,
ciphertext: Vec<u8>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make it a map of name: encrypted_value instead and encrypt both with the same key and nonce? Parsing with serde_json is very expensive, so it's better to avoid it where possible.

Err(_) => {
return None;
}
let EncryptedHeaders {identity, nonce, ciphertext,} = local_assignment.encrypted_headers.clone();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it can be a reference instead of a clone

@@ -154,15 +177,34 @@ impl Assignment {
}

pub fn regenerate_headers(&mut self, cloudflare_storage_secret: String) {
let alice_secret_key = SecretKey::generate(&mut OsRng);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just call it temp key and worker key before committing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants