From: Fred Hamster Date: Tue, 6 Oct 2026 23:15:10 +0000 (-0400) Subject: cleaning out inadvertent references to blowfish X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fdev;p=feisty_meow.git cleaning out inadvertent references to blowfish trying to minimize how much we refer to the almighty non-working blowfish at this point. --- diff --git a/nucleus/library/crypto/cryptical_envelopment.cpp b/nucleus/library/crypto/cryptical_envelopment.cpp index d90af5c7..1d125010 100644 --- a/nucleus/library/crypto/cryptical_envelopment.cpp +++ b/nucleus/library/crypto/cryptical_envelopment.cpp @@ -23,7 +23,6 @@ #include #include -///#include #include #include @@ -35,13 +34,7 @@ using namespace structures; namespace crypto { const int FUDGE = 1024; - /* extra space for the cipher's block size. blowfish, e.g., is only 8 bytes for - the cipher block size, so we'd only ever need possibly 8 bytes padding? - */ -//hmmm: guarantee the fudge space is enough for other algorithms! - -//#undef set_key - // get rid of a macro we don't want. + /* extra space for the cipher's block size. */ //#define DEBUG_CRYPTICAL_ENVELOPMENT // uncomment for noisier version. @@ -178,7 +171,12 @@ bool cryptical_envelopment::generate_key(int size, byte_array &new_key) for (int i = 0; i < bytes; i++) new_key[i] = static_ssl_initializer().randomizer().inclusive(0, 255); -//code that we thought might be necessary but which doesn't help blowfish not suck. +/* + the wipe unused bits code... we thought this might be necessary at one + point, but have never found it to help anything. doesn't seem to impede + twofish from working properly, but that doesn't mean we leave it turned + on. yuck. +*/ //#define WIPE_UNUSED_BITS #ifdef WIPE_UNUSED_BITS // clear the bits that cannot be non-zero for a key whose bits are not evenly divisible by 8. diff --git a/nucleus/library/crypto/ssl_init.cpp b/nucleus/library/crypto/ssl_init.cpp index ea9d45b1..ed202d26 100644 --- a/nucleus/library/crypto/ssl_init.cpp +++ b/nucleus/library/crypto/ssl_init.cpp @@ -59,7 +59,7 @@ ssl_init::ssl_init() FUNCDEF("ctor"); LOG("prior to provider setup"); - // new code needed because blowfish is considered legacy code now. ugh. + // load the legacy provider to get access to blowfish and other antiques. c_legacy_provider = OSSL_PROVIDER_load(NULL_POINTER, "legacy"); if (!c_legacy_provider) { ALWAYS_LOG("failed to load legacy openssl provider! mega boofer fail!"); diff --git a/nucleus/library/crypto/ssl_init.h b/nucleus/library/crypto/ssl_init.h index fbda4516..a181d6b9 100644 --- a/nucleus/library/crypto/ssl_init.h +++ b/nucleus/library/crypto/ssl_init.h @@ -25,7 +25,7 @@ struct ossl_provider_st; namespace crypto { -//! provides some initialization for the RSA and blowfish crypto. +//! provides some initialization for the cryptography engines. /*! This class does the SSL initialization needed before any functions can be used. It also sets up the random seed for SSL. NOTE: you should never @@ -33,8 +33,10 @@ namespace crypto { very bottom and it will be managed globally for the entire program. */ -// we define NEWER_OPENSSL for those places where we're using more recent versions. -// this forces the code to choose newer methods over deprecated ones. +/* + we define NEWER_OPENSSL for those places where we're using more recent versions. + this forces the code to choose newer methods over deprecated ones. +*/ #if OPENSSL_VERSION_NUMBER > 0x10100000L #define NEWER_OPENSSL #endif diff --git a/nucleus/library/filesystem/huge_file.cpp b/nucleus/library/filesystem/huge_file.cpp index 5d8e7dc0..17860617 100644 --- a/nucleus/library/filesystem/huge_file.cpp +++ b/nucleus/library/filesystem/huge_file.cpp @@ -316,7 +316,7 @@ basis::outcome huge_file::touch() byte_array junk(1); int written; outcome ret = write(junk, written); - if (ret != OKAY) ret; + if (ret != OKAY) return ret; if (!truncate()) return FAILURE; } diff --git a/nucleus/library/tests_crypto/test_blowfish_crypto.cpp b/nucleus/library/tests_crypto/test_blowfish_crypto.cpp index 41d5f22b..d51605dc 100644 --- a/nucleus/library/tests_crypto/test_blowfish_crypto.cpp +++ b/nucleus/library/tests_crypto/test_blowfish_crypto.cpp @@ -97,8 +97,10 @@ int test_blowfish::execute() LOG("starting blowfish test..."); #endif - // a known hack--we have bad failures in this test, thanks to openssl as far - // as we can tell. so we signal not to fail in the test results. + /* + a known hack--we have bad failures in this test, thanks to openssl as far + as we can tell. so we signal not to fail in the test results. + */ set_failures_are_critial(false); int left = THREAD_COUNT; diff --git a/nucleus/library/unit_test/unit_base.h b/nucleus/library/unit_test/unit_base.h index 996ae517..887356a1 100644 --- a/nucleus/library/unit_test/unit_base.h +++ b/nucleus/library/unit_test/unit_base.h @@ -69,10 +69,11 @@ public: bool failures_are_critical() const { return c_fail_on_errors; } /*!< - * report whether we consider test errors to be a critical failure. if true, then any - * error causes a non-zero exit return from the unit test. if false, then the successful - * zero exit occurs instead. this allows a test which is known to fail to not break the - * build (ahem, borked blowfish!). + * report whether we consider test errors to be a critical failure. + * if true (which is the default), then any error causes a non-zero exit + * return from the unit test. if set to false (optional), then the + * successful zero exit occurs even when errors are seen in the tests. + * this keeps a test which is known to fail from breaking the build. */ void set_failures_are_critial(bool are_failures_critical) { c_fail_on_errors = are_failures_critical; } //