1. Feb 22, 2021
    • Richard Levitte's avatar
      Also build gost-engine in library form · d9a2b297
      Richard Levitte authored
      In this form, the GOST engine isn't loadable through OpenSSL's dynamic
      ENGINE loader, but directly as its own function, ENGINE_load_gost().
      After making that call, the engine functionality can be used as usual.
      This includes a public header file called gost-engine.h, which declares
      that functions.
      
      This also rearranges the code in gost_eng.c, as the binding
      functionality was spread around in the file.  Now, it's all nicely
      tucked at the end.
      d9a2b297
  2. Feb 21, 2021
  3. Feb 20, 2021
  4. Feb 18, 2021
  5. Feb 17, 2021
  6. Feb 16, 2021
    • Richard Levitte's avatar
      Remove the use of test/run_tests in favor of 'prove' · 4573beda
      Richard Levitte authored
      'prove' is a well developed TAP harness program, there's no real need
      to write one's own.
      
      We do need to set certain paths properly for the appropriate 'openssl'
      program to be run.  We do that with a 'prove' plugin (WrapOpenSSL.pm)
      that simply amends the appropriate system environment variables, given
      a number of cmake generated environment variables that indicate where
      OpenSSL files reside.
      4573beda
  7. Feb 15, 2021
    • Richard Levitte's avatar
      Move gost_cmds[] from gost_ctl.c to gost_eng.c · f2bbf8ca
      Richard Levitte authored
      This make that array uniquely belonging to the engine proper, while
      leaving the more generic gost parameters functionality in the
      gost_core library.
      f2bbf8ca
    • Richard Levitte's avatar
      Cleanup source organisation, and make 'gost' an actual module · c8666fa2
      Richard Levitte authored
      GOST_CORE_SOURCE_FILES and GOST_ENGINE_SOURCE_FILES were a bit
      disorganised, they are now re-arranged so GOST_ENGINE_SOURCE_FILES
      contains ENGINE specific source only, and what was less ENGINE
      specific was moved to GOST_CORE_SOURCE_FILES.  Furthermore,
      GOST_LIB_SOURCE_FILES now includes GOST_CORE_SOURCE_FILES, so the
      gost_core library is complete with all implementations.
      
      As a consequence, 'gost' is now explicitly made into a dlopenable
      module.  On some operating systems, that makes a difference.
      
      This paves the way for alternative implementations based on the same
      base code, such as a provider implementation.
      
      It's quite possible that the re-arrangement done here isn't "pure"
      enough.  Future development will tell.
      c8666fa2
  8. Feb 07, 2021
  9. Jan 21, 2021
  10. Jan 08, 2021
  11. Dec 06, 2020
    • Alexei A. Smekalkine's avatar
      gost_crypt: process full available block in CFB and CNT mode · 711b83cb
      Alexei A. Smekalkine authored
      If at the input of the encryption function in the CFB mode we have
      an integer number of blocks, then in the main loop all blocks will be
      processed, except for the last one due to an incorrect border check.
      The last block will be fully processed as a "partial" remainder, but
      the initialization vector will not be updated. And, thus, the value
      of IV will always be incorrect in this case.
      
      This breaks stateless protocols due to an invalid initialization vector:
      all messages except the first cannot be decrypted. (Naturally, we are
      talking about a case with disabled key meshing, which does not allow
      context recovery due to an erroneous implementation.)
      
      It is worth noting here that the code for processing partial blocks
      (both at the input of the encryption functions and at the output) is
      a historically unnecessary artifact, since we do not set the
      EVP_CIPH_FLAG_CUSTOM_CIPHER flag and, as a result, OpenSSL processes
      partial blocks for us.
      
      This patch corrects the checking of the main loop boundary.
      
      A similar error is present in the code for the CNT mode, but there it
      does not manifest itself in any way, because the restoration of the
      state in this mode is impossible: even after disabling key meshing, we
      still have the state-dependent transformation of the IV.
      
      As an extra result of this fix, the code for processing partial blocks
      can be completely removed now.
      
      (cherry picked from commit cf402dd4)
      711b83cb
  12. Nov 29, 2020
  13. Nov 20, 2020
  14. Nov 13, 2020
  15. Nov 05, 2020
  16. Oct 29, 2020
    • Vitaly Chikunov's avatar
      CMakeLists.txt: Fix warning on gcc-9 · 6c7addf7
      Vitaly Chikunov authored
      /root/rpmbuild/BUILD/openssl-gost-engine-1.1.1/CMakeFiles/CMakeTmp/src.c:4:14: warning: initialization of 'int *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
          4 |     int *p = buf + 1;
            |              ^~~
      /root/rpmbuild/BUILD/openssl-gost-engine-1.1.1/CMakeFiles/CMakeTmp/src.c:5:14: warning: initialization of 'int *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
          5 |     int *q = buf + 2;
            |              ^~~
      
      Reported-by: Ilya Shipitsin <https://github.com/chipitsine>
      Fixes: #288
      6c7addf7
  17. Oct 09, 2020
  18. Oct 04, 2020
  19. Sep 27, 2020
  20. Sep 24, 2020
  21. Sep 21, 2020
  22. Sep 18, 2020
  23. Sep 02, 2020
  24. Aug 28, 2020
  25. Aug 22, 2020
  26. Aug 21, 2020
  27. Aug 20, 2020