used to verify client has correct key and can decrypt audit log header
(key, iv, src []byte)
| 184 | |
| 185 | // used to verify client has correct key and can decrypt audit log header |
| 186 | func decrypt(key, iv, src []byte) ([]byte, error) { |
| 187 | ivCopy := make([]byte, 16) |
| 188 | copy(ivCopy, iv[:]) // todo: do we need to copy here? |
| 189 | |
| 190 | plainText, err := y.XORBlockAllocate(src, key, ivCopy) |
| 191 | if err != nil { |
| 192 | return nil, err |
| 193 | } |
| 194 | return plainText, nil |
| 195 | } |
| 196 | |
| 197 | func (l *LogWriter) rotate() error { |
| 198 | if l == nil { |