mirror of
https://github.com/cloudflare/redoctober.git
synced 2026-01-07 05:56:56 +00:00
Shorten key by 2 bits.
This commit is contained in:
committed by
Brendan McMillion
parent
e652300f43
commit
9e514e902a
@@ -466,6 +466,11 @@ func (c *Cryptor) Encrypt(in []byte, labels []string, access AccessStructure) (r
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if len(access.Predicate) > 0 {
|
||||
// The first two bits of the key need to be removed to prevent wrapping
|
||||
// because the modulus is slightly too small.
|
||||
clearKey[0] &= 63
|
||||
}
|
||||
|
||||
err = encrypted.wrapKey(c.records, clearKey, access)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user