Code Monkey home page Code Monkey logo

dstu-engine's People

Contributors

bogdartysh avatar gentoo90 avatar madf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dstu-engine's Issues

Investigate crash in CMS test.

Stack trace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7c6d5e0 in CMS_SignerInfo_verify (si=0x555555617d90) at crypto/cms/cms_sd.c:835
835	    fetched_md = EVP_MD_fetch(ctx->libctx, name, ctx->propq);
(gdb) bt
#0  0x00007ffff7c6d5e0 in CMS_SignerInfo_verify (si=0x555555617d90) at crypto/cms/cms_sd.c:835
#1  0x00007ffff7c6f0d0 in CMS_verify (cms=0x5555555e4250, certs=0x0, store=0x0, dcont=0x0, out=0x0, flags=32) at crypto/cms/cms_smime.c:381
#2  0x000055555555a954 in (anonymous namespace)::testVerifyCMS (engine=0x5555555891e0, file="cms.pem") at /home/faust/Projects/dstu-engine/tests/test.cpp:370
#3  0x000055555555b3d7 in (anonymous namespace)::testPKey (engine=0x5555555891e0) at /home/faust/Projects/dstu-engine/tests/test.cpp:410
#4  0x000055555555b7a2 in main () at /home/faust/Projects/dstu-engine/tests/test.cpp:432

docker image

Would be nice to have some docker compose image with all needed staff (cmake, make, gcc, openssl) with workable versions to simplify new-commers

Issue runnig engine with undefined symbol: EC_GROUP_new_curve_GF2m

Engine built and installed successfully but test going to fail on Fedora Linux x64

$ sudo make install

...
Install the project...
-- Install configuration: ""
-- Installing: /usr/lib64/engines-1.1/dstu.so
-- Installing: /usr/local/lib/libkeylib.so
-- Up-to-date: /usr/local/include/keylib/keylib.h
-- Up-to-date: /usr/local/include/keylib/keystore.h
-- Up-to-date: /usr/local/include/keylib/key6.h
-- Up-to-date: /usr/local/include/keylib/jks.h
-- Up-to-date: /usr/local/include/keylib/pkcs12.h

$ openssl cms -verify -engine dstu -in tests/cms.pem -inform PEM -noverify

invalid engine "dstu"
140498579156480:error:25066067:DSO support routines:dlfcn_load:could not load the shared library:crypto/dso/dso_dlfcn.c:118:filename(/usr/lib64/engines-1.1/dstu.so): /usr/lib64/engines-1.1/dstu.so: undefined symbol: EC_GROUP_new_curve_GF2m
140498579156480:error:25070067:DSO support routines:DSO_load:could not load the shared library:crypto/dso/dso_lib.c:162:
140498579156480:error:260B6084:engine routines:dynamic_load:dso not found:crypto/engine/eng_dyn.c:434:
140498579156480:error:2606A074:engine routines:ENGINE_by_id:no such engine:crypto/engine/eng_list.c:421:id=dstu
140498579156480:error:25066067:DSO support routines:dlfcn_load:could not load the shared library:crypto/dso/dso_dlfcn.c:118:filename(libdstu.so): libdstu.so: cannot open shared object file: No such file or directory
140498579156480:error:25070067:DSO support routines:DSO_load:could not load the shared library:crypto/dso/dso_lib.c:162:
140498579156480:error:260B6084:engine routines:dynamic_load:dso not found:crypto/engine/eng_dyn.c:434:
Verification failure
140498579156480:error:0609E09C:digital envelope routines:pkey_set_type:unsupported algorithm:crypto/evp/p_lib.c:210:
140498579156480:error:0B09406F:x509 certificate routines:x509_pubkey_decode:unsupported algorithm:crypto/x509/x_pubkey.c:114:
140498579156480:error:2E098086:CMS routines:CMS_SignerInfo_verify:no public key:crypto/cms/cms_sd.c:733:

$ openssl version
OpenSSL 1.1.1q FIPS 5 Jul 2022

Could you clarify if it indicates some missing debs, a new version of OpenSSL, or distro specific issue?

can't load dstu engine

$ openssl OpenSSL> engine dstu

139949105176064:error:25066067:DSO support routines:dlfcn_load:could not load the shared library:crypto/dso/dso_dlfcn.c:118:filename(/usr/lib64/engines-1.1/dstu.so): /usr/lib64/engines-1.1/dstu.so: undefined symbol: EC_GROUP_new_curve_GF2m

openssl version: OpenSSL 1.1.1q FIPS 5 Jul 2022

test_jks crashes in release mode.

Backtrace:

Starting program: /home/faust/Projects/dstu-engine/build/tests/test_jks
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d67945 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
(gdb) bt
#0  0x00007ffff7d67945 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#1  0x00007ffff7d65ca8 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#2  0x00007ffff7d65dc5 in ASN1_item_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#3  0x00007ffff7fc14ed in JKSEntryFree () from /home/faust/Projects/dstu-engine/build/keylib/libkeylib.so
#4  0x00007ffff7fc159d in JKSFree () from /home/faust/Projects/dstu-engine/build/keylib/libkeylib.so
#5  0x00005555555569d4 in main ()

Tests are broken

FAILED: tests/CMakeFiles/common.dir/block.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/keylib  -march=native -O2 -pipe -mmmx -msse4.2 -mssse3 -mfpmath=sse -fomit-frame-pointer         -frecord-gcc-switches -std=c++14 -MD -MT tests/CMakeFiles/common.dir/block.cpp.o -MF tests/CMakeFiles/common.dir/block.cpp.o.d -o tests/CMakeFiles/common.dir/block.cpp.o -c /var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp
/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp: In function 'void DSTUEngine::printBlock(const void*, size_t)':
/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp:49:41: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
   49 |     const auto* ptr = static_cast<const uint8_t*>(data);
      |                                         ^~~~~~~
/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp:49:41: error: expected '>' before 'uint8_t'
/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp:49:41: error: expected '(' before 'uint8_t'
   49 |     const auto* ptr = static_cast<const uint8_t*>(data);
      |                                         ^~~~~~~
      |                                         (
/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp:49:41: error: 'uint8_t' was not declared in this scope
   49 |     const auto* ptr = static_cast<const uint8_t*>(data);
      |                                         ^~~~~~~
/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp:7:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
    6 | #include <iomanip>
  +++ |+#include <cstdint>
    7 | #include <stdexcept>
/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp:49:49: error: expected primary-expression before '>' token
   49 |     const auto* ptr = static_cast<const uint8_t*>(data);
      |                                                 ^
/var/tmp/portage/dev-libs/dstu-engine-1.3.2/work/dstu-engine-1.3.2/tests/block.cpp:49:56: error: expected ')' before ';' token
   49 |     const auto* ptr = static_cast<const uint8_t*>(data);
      |                                                        ^
      |                                                        )

Check GF(2^m) support

RedHat derivatives, Fedora in particular, ship OpenSSL without EC over GF(2^m). DSTU 4145 uses this kind of EC, so we need to check if OpenSSL supports it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.