dstucrypt / dstu-engine Goto Github PK
View Code? Open in Web Editor NEWOpenSSL DSTU engine.
License: Apache License 2.0
OpenSSL DSTU engine.
License: Apache License 2.0
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
Build, test, check coverage.
Would be nice to have some docker compose image with all needed staff (cmake, make, gcc, openssl) with workable versions to simplify new-commers
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?
$ 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
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 ()
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);
| ^
| )
Subj.
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.
Subj and add doc notes about non-standard installation (openssl.cnf
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.