[MacPorts] #64036: SoftHSMv2 port causes free-after-free

MacPorts noreply at macports.org
Tue May 23 22:59:41 UTC 2023


#64036: SoftHSMv2 port causes free-after-free
-------------------------+--------------------
  Reporter:  mouse07410  |      Owner:  (none)
      Type:  defect      |     Status:  new
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  softhsm     |
-------------------------+--------------------

Comment (by mouse07410):

 Also, it would be great if the following patch was applied:
 {{{
 diff --git a/src/lib/crypto/OSSLCryptoFactory.cpp
 b/src/lib/crypto/OSSLCryptoFactory.cpp
 index ace4bcb..b5456d4 100644
 --- a/src/lib/crypto/OSSLCryptoFactory.cpp
 +++ b/src/lib/crypto/OSSLCryptoFactory.cpp
 @@ -175,6 +175,7 @@ OSSLCryptoFactory::OSSLCryptoFactory()
                             OPENSSL_INIT_LOAD_CRYPTO_STRINGS |
                             OPENSSL_INIT_ADD_ALL_CIPHERS |
                             OPENSSL_INIT_ADD_ALL_DIGESTS |
 +                            OPENSSL_INIT_NO_ATEXIT |
                             OPENSSL_INIT_LOAD_CONFIG, NULL);
  #endif

 @@ -238,7 +239,7 @@ OSSLCryptoFactory::~OSSLCryptoFactory()
         // Detect that situation because reinitialisation will fail
         // after OPENSSL_cleanup() has run.
         (void)ERR_set_mark();
 -       ossl_shutdown = !OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND,
 NULL);
 +       ossl_shutdown = !OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND |
 OPENSSL_INIT_NO_ATEXIT, NULL);
         (void)ERR_pop_to_mark();
  #endif
         if (!ossl_shutdown)
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/64036#comment:22>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list