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

Make CipherCtx::cipher_update more flexible #1733

Merged
merged 2 commits into from Nov 26, 2022

Commits on Nov 24, 2022

  1. Copy the full SHA
    0106165 View commit details
    Browse the repository at this point in the history
  2. Make CipherCtx::cipher_update more flexible

    This change relaxes constraints on the output buffer size when it can be
    safely determined how many bytes will be put in the output buffer.
    
    For supported cryptographic backends (OpenSSL >= 1.1) the cipher's `num`
    parameter will be consulted for the number of bytes in the block cache.
    For unsupported backends the behavior will not change (the code will
    assume full block in the cache).
    
    For callers that do the check themselves and want to use other backends
    (e.g. BoringSSL or LibreSSL) and unsafe `cipher_update_unchecked`
    function is added.
    
    Additionally a `CipherCtx::minimal_output_size` function is added for
    letting the callers know how big should the output buffer be for the
    next `cipher_update` call.
    
    Fixes sfackler#1729.
    
    See: https://mta.openssl.org/pipermail/openssl-users/2022-November/015623.html
    wiktor-k committed Nov 24, 2022
    Copy the full SHA
    5ecff30 View commit details
    Browse the repository at this point in the history