Giter Site home page Giter Site logo

Comments (7)

fr05t1k avatar fr05t1k commented on August 28, 2024

Привет! Я добавил возможности указвать флаги для openssl_pkcs7_sign (https://www.php.net/manual/en/openssl.pkcs7.flags.php).

Попробуй добавить флаг $signer->addPKCS7Flag(PKCS7_NOSIGS) или $signer->addPKCS7Flag(PKCS7_NOVERIFY)

from esia.

fluffycondor avatar fluffycondor commented on August 28, 2024

Увы, эффекта не даёт, варнинг на месте.
Даже
PKCS7_NOVERIFY | PKCS7_NOATTR | PKCS7_NOCERTS | PKCS7_NOCHAIN | PKCS7_NOINTERN

from esia.

fr05t1k avatar fr05t1k commented on August 28, 2024

А это секретные ключи? Можешь поделиться?

from esia.

fluffycondor avatar fluffycondor commented on August 28, 2024

Я не думаю, что дело в ключах. Скорее всего, дело в связке определенных версий PHP + openssl (у нас это PHP 7.3.19 и OpenSSL 1.1.1d). Глубже я не компетентен - ГОСТовское шифрование настраивал наш девопс с бубнами и матами, из-за этого у нас и лок на PHP 7.3, на 7.4 что-то не заводится.
Вот рандомный тестовый серт + ключ, с ним у нас проблема воспроизводится.
fam002.zip

from esia.

fr05t1k avatar fr05t1k commented on August 28, 2024

Я не встретил проблем с сетификатом и ключем которые в репозитории на:
PHP 7.3.19 (cli) (built: Jun 11 2020 19:52:31) ( NTS )
OpenSSL 1.1.1d 10 Sep 2019

С теми что в архиве не завелось с ошибкой: error:0609E09C:digital envelope routines:pkey_set_type:unsupported algorithm

from esia.

fr05t1k avatar fr05t1k commented on August 28, 2024

Как вариант можете использовать CLI версию:

  1. Установить пакет gost
  2. Добавить конфиг
  3. Использоать CliSignerPKCS7

from esia.

fluffycondor avatar fluffycondor commented on August 28, 2024

А если добавить в конфиг опцию supressPKCS7Warnings и по ее наличию оборачивать openssl_pkcs7_sign в

$oldErrorReportingLevel = error_reporting(E_ALL & ~E_WARNING); // выключает только варнинги
$signResult = openssl_pkcs7_sign(
     $messageFile,
     $signFile,
     $cert,
     $privateKey,
     []
); 
error_reporting($oldErrorReportingLevel);

from esia.

Related Issues (20)

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.