Skip to content

EVP_CipherUpdate() setting AAD for AES-256-OCB returns incorrect outlen #8310

@jorangreef

Description

@jorangreef

In OpenSSL 1.1.1a, setting AAD for AES-256-OCB mode using EVP_CipherUpdate() returns a surprising outlen. I would have expected outlen to match aad_size but it seems to be truncated down to the nearest multiple of blocks, unlike ciphers such as GCM or ChaCha20-Poly1305.

int outlen = 0;
EVP_CipherUpdate(ctx, NULL, &outlen, aad, aad_size);
if (outlen != aad_size) {
  printf("outlen=%i aad_size=%i\n", outlen, aad_size);
}
assert(outlen == aad_size);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions