-
Notifications
You must be signed in to change notification settings - Fork 168
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
Nonce removal from vss/EncryptedDeal struct #524
Conversation
Please retry analysis of this Pull-Request directly on SonarCloud |
Quality Gate failedFailed conditions |
@@ -408,7 +405,8 @@ func (v *Verifier) decryptDeal(e *EncryptedDeal) (*Deal, error) { | |||
if err != nil { | |||
return nil, err | |||
} | |||
decrypted, err := gcm.Open(nil, e.Nonce, e.Cipher, v.hkdfContext) | |||
nonce := make([]byte, gcm.NonceSize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it intentional to pass in an empty slice here? it seems like it'd be better to remove it entirely (though this breaks the interface for other users potentially)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understood well your point but I'll try to answer anyway.
It's not possible to not pass the nonce, as it's required from the gcm interfact; additionally, if we were to pass nil instead that wouldn't work either, as it has to match the NonceSize(). Also, this is a v4 change, so it's okay to break our interfaces (the encrypted deal in this case).
This PR resolves #379 by removing the nonce from the Encrypted Deal struct (as it's always 0)