Page MenuHomePhabricator

OpenSSL memory sanity check
Open, WishlistPublic

Description

OpenSSL supportes memory debugging (requires rebuild of openssl with crypto-mdebug), which can capture corner cases of allocating something through openssl function and freeing it using normal free() or vice versa. These errors generally do not cause any issues in production systems, but could fail in picky debuggers or on different platforms.

It would be nice to have CI target that could rebuild openssl with crypto-debug support and plug into libssh tests CRYPTO_set_mem_debug() and CRYPTO_mem_leaks() functions to track OpenSSL inconsistencies.

https://www.openssl.org/docs/man1.1.0/man3/OPENSSL_malloc.html

Event Timeline

Jakuje triaged this task as Wishlist priority.May 6 2020, 11:51 AM
Jakuje created this task.

@Jakuje Do you think we should address this in libssh 1.0.0?
we could also look into some similiar support in OpenSSL3.0, when we add support for it.

This could be a nice exercise when getting familiar with openssl :) It makes sense to do it with openssl 3.0 more than with the 1.1.1, but as written in the description, it does not have a potential to finding many bugs with high impact.