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

Test and deprecate Themis 0.9.6 compatibility path #614

Merged
merged 15 commits into from
Apr 1, 2020

Commits on Mar 26, 2020

  1. Test for Themis 0.9.6 compatibility

    One historical version of Themis has been using incorrect KDF which
    produced data that cannot be decrypted with the correct function.
    In order to work around this issue, the code contains a fallback path
    which tries the incorrect compatibility KDF if decryption fails with
    the derived key produced by the correct KDF.
    
    Unfortunately, this code path is not tested whatsoever and this is not
    good. Add tests that verify that Themis is able decrypt data produced
    by buggy Themis 0.9.6.
    
    P.S. clang-format surely has some weirdly twisted idea about how byte
    arrays should be formatted *sigh* whatever...
    ilammy committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    7b500aa View commit details
    Browse the repository at this point in the history
  2. Cleanup Context Imprint compatibility code path

    Extract key derivation into functions like this is done for Seal and
    Token Protect mode. This makes the code more readable and highlights
    the compatibility issue that we are dealing with.
    
    Update the usage sites too, remove magic macros, make sure that the
    derived keys are wiped after processing.
    ilammy committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    459b9e7 View commit details
    Browse the repository at this point in the history
  3. Cleanup Context Imprint IV computation

    It's really not obvious why Context Imprint's IV computatation is
    performed with a key derivation function. At least extract this bit
    into a separate function that can be commented.
    
    Cleanup the usage sites, replace macros with plain C code, make sure
    that IV is wiped after processing since it is derived from the key.
    ilammy committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    5adcf33 View commit details
    Browse the repository at this point in the history
  4. Drop unused typedef themis_sym_message_hdr_t

    It has never been used since Context Imprint mode does not produce any
    authentication token that needs a header.
    ilammy committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    b31cf33 View commit details
    Browse the repository at this point in the history
  5. Remove SCELL_COMPAT define and ignore NO_SCELL_COMPAT variable

    It does not really make much sense for the users to not enable the
    compatibility code path that allows to decrypt historical data.
    In fact, not a single build that we distribute disables this code
    path.
    
    Remove all SCELL_COMPAT ifdefs and ignore NO_SCELL_COMPAT setting,
    making the compatibility always enabled.
    
    This has a side effect of slightly slowing down decryption of really
    corrupted messages since we will be always trying the fallback path.
    However, this is not that significant loss as originally envisioned,
    and normal usage of Themis should not be affected.
    ilammy committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    8a1781f View commit details
    Browse the repository at this point in the history
  6. Use compatibility path on 32-bit machines too

    First of all, 64-bit machines are more common so this code path will be
    used in almost all cases. Second, 32-bit machines may need to deal with
    data encrypted by Themis 0.9.6 on 64-bit machines, so disabling it for
    32-bit machines does not make much sense.
    ilammy committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    dfa33a5 View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2020

  1. Configuration menu
    Copy the full SHA
    545e782 View commit details
    Browse the repository at this point in the history
  2. Disable SCELL_COMPAT by default

    Leave the compatibility code disable by default from now on. The
    NO_SCELL_COMPAT configuration variable is now ignored. Instead,
    WITH_SCELL_COMPAT=1 will enable the compatibility.
    
    This compatibility code is going to be removed when Themis 0.9.6 finally
    reaches end-of-life on 2020-12-13, so we are getting ready for it.
    ilammy committed Mar 27, 2020
    Configuration menu
    Copy the full SHA
    a6de319 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9676fda View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    39a4a1a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0846314 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2020

  1. Move "error" label inside SCELL_COMPAT ifdef

    It happens to be used only by the compatibility code, so if it is
    disabled then compiler starts spewing warnings about unused labels
    and this makes our warning-free CI build unhappy. We will not need
    this label with compatibility code removed so move it there.
    ilammy committed Mar 28, 2020
    Configuration menu
    Copy the full SHA
    ab34fa2 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into always-compat

    Sync with master branch since some of git hackery in CocoaPods builds
    seems to be not working well with branches. It should be okay when this
    code is synchronized with master.
    ilammy committed Mar 28, 2020
    Configuration menu
    Copy the full SHA
    5631124 View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2020

  1. Configuration menu
    Copy the full SHA
    78ffd13 View commit details
    Browse the repository at this point in the history
  2. Reword changelog for clarity

    ilammy committed Mar 30, 2020
    Configuration menu
    Copy the full SHA
    7932990 View commit details
    Browse the repository at this point in the history