From fabdb67ddd25938fd6a5ff73110a07a6d5d0b507 Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Wed, 29 Apr 2026 19:21:06 -0400 Subject: [PATCH] small progress, still not building. --- nucleus/library/tests_crypto/makefile | 4 +--- octopi/library/cromp/cromp_client.cpp | 2 +- octopi/library/cromp/cromp_client.h | 4 ++-- octopi/library/tentacles/encryption_infoton.cpp | 8 ++++---- octopi/library/tentacles/encryption_infoton.h | 6 +++--- octopi/library/tentacles/encryption_tentacle.cpp | 6 +++--- octopi/library/tentacles/key_repository.cpp | 4 ++-- octopi/library/tentacles/key_repository.h | 8 ++++---- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/nucleus/library/tests_crypto/makefile b/nucleus/library/tests_crypto/makefile index 58b48471..58b9ff7c 100644 --- a/nucleus/library/tests_crypto/makefile +++ b/nucleus/library/tests_crypto/makefile @@ -2,9 +2,7 @@ include cpp/variables.def PROJECT = tests_crypto TYPE = test -TARGETS = test_blowfish_crypto.exe test_old_school_rsa_crypto.exe test_twofish_crypto.exe -# test_blowfish_crypto.exe -- currently blows up, which we think is an error in openssl, because the twofish crypto works perfectly using the same -# cryptical envelopment base. this is annoying, but we could stop using the legacy provider entirely if we didn't do blowfish any more. not yet. +TARGETS = test_blowfish_crypto.exe test_old_school_rsa_crypto.exe test_twofish_crypto.exe LOCAL_LIBS_USED = unit_test crypto application processes loggers configuration textual timely \ filesystem structures basis USE_SSL = t diff --git a/octopi/library/cromp/cromp_client.cpp b/octopi/library/cromp/cromp_client.cpp index 1c58b010..53a86ec8 100644 --- a/octopi/library/cromp/cromp_client.cpp +++ b/octopi/library/cromp/cromp_client.cpp @@ -135,7 +135,7 @@ cromp_client::cromp_client(const internet_address &addr, int connection_wait, _disallowed(false), _asynch_connector(NULL_POINTER), _channel_secured(false), - _crypto(new blowfish_crypto(encryption_infoton::BLOWFISH_KEY_SIZE)), + _crypto(new twofish_crypto(encryption_infoton::BLOWFISH_KEY_SIZE)), _encrypt_arm(NULL_POINTER), _guardian(new blank_entity_registry), c_verification(new byte_array) diff --git a/octopi/library/cromp/cromp_client.h b/octopi/library/cromp/cromp_client.h index 20434cfb..333de65e 100644 --- a/octopi/library/cromp/cromp_client.h +++ b/octopi/library/cromp/cromp_client.h @@ -28,7 +28,7 @@ #include "cromp_common.h" -#include +#include #include #include #include @@ -175,7 +175,7 @@ private: friend class asynch_connection_thread; // solely so it can use r_p_c method. asynch_connection_thread *_asynch_connector; // b-ground connection thread. bool _channel_secured; // true if an encrypted connection has been made. - crypto::blowfish_crypto *_crypto; // tracks our key, once we have one. + crypto::twofish_crypto *_crypto; // tracks our key, once we have one. octopi::encryption_tentacle *_encrypt_arm; // processes encryption for us. octopi::blank_entity_registry *_guardian; // simple security support. basis::byte_array *c_verification; // verification token we were given. diff --git a/octopi/library/tentacles/encryption_infoton.cpp b/octopi/library/tentacles/encryption_infoton.cpp index 36f06985..fb3b4c60 100644 --- a/octopi/library/tentacles/encryption_infoton.cpp +++ b/octopi/library/tentacles/encryption_infoton.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -103,7 +103,7 @@ bool encryption_infoton::unpack(byte_array &packed_form) return true; } -outcome encryption_infoton::prepare_blowfish_key(blowfish_crypto &new_key) +outcome encryption_infoton::prepare_blowfish_key(twofish_crypto &new_key) { FUNCDEF("prepare_blowfish_key"); _encrypted_blowfish_key.reset(); // clean out stuff to create. @@ -114,7 +114,7 @@ outcome encryption_infoton::prepare_blowfish_key(blowfish_crypto &new_key) } old_school_rsa_crypto pub(_public_key); // suck in the provided key. - blowfish_crypto agreed_key(BLOWFISH_KEY_SIZE); // random blowfish key. + twofish_crypto agreed_key(BLOWFISH_KEY_SIZE); // random blowfish key. new_key = agreed_key; // now encrypt the new key for transit. @@ -141,7 +141,7 @@ outcome encryption_infoton::prepare_public_key(const old_school_rsa_crypto &priv } outcome encryption_infoton::extract_response(const old_school_rsa_crypto &private_key, - blowfish_crypto &new_key) const + twofish_crypto &new_key) const { FUNCDEF("extract_response"); if (_success != tentacle::OKAY) return _success; diff --git a/octopi/library/tentacles/encryption_infoton.h b/octopi/library/tentacles/encryption_infoton.h index 9f02b217..c395d210 100644 --- a/octopi/library/tentacles/encryption_infoton.h +++ b/octopi/library/tentacles/encryption_infoton.h @@ -15,7 +15,7 @@ * Please send any updates to: fred@gruntose.com * \*****************************************************************************/ -#include +#include #include #include #include @@ -62,7 +62,7 @@ public: encryption_infoton &operator =(const encryption_infoton &to_copy); - basis::outcome prepare_blowfish_key(crypto::blowfish_crypto &new_key); + basis::outcome prepare_blowfish_key(crypto::twofish_crypto &new_key); //!< performs the server side's job on the current key. /*!< the public key had better be set already or this will fail. the "new_key" will always be used to communicate with the client after this. @@ -76,7 +76,7 @@ public: //!< sets up both keys by randomly generating the "private_key". basis::outcome extract_response(const crypto::old_school_rsa_crypto &private_key, - crypto::blowfish_crypto &new_key) const; + crypto::twofish_crypto &new_key) const; //!< used by the client to extract the shared blowfish key from the server. /*!< using the private key, the server's response is decrypted and stored in "new_key". note that this will only succeed if the _success member diff --git a/octopi/library/tentacles/encryption_tentacle.cpp b/octopi/library/tentacles/encryption_tentacle.cpp index 7cfe5046..2256c87c 100644 --- a/octopi/library/tentacles/encryption_tentacle.cpp +++ b/octopi/library/tentacles/encryption_tentacle.cpp @@ -16,7 +16,7 @@ #include "encryption_wrapper.h" #include "key_repository.h" -#include +#include #include #include #include @@ -149,7 +149,7 @@ outcome encryption_tentacle::consume(infoton &to_chow, if (!_server_side) { // client's side must track the key we were given for decryption. we'll // use that from now on. - blowfish_crypto new_key(blowfish_crypto::minimum_key_size()); // bogus. + twofish_crypto new_key(twofish_crypto::minimum_key_size()); // bogus. outcome ret = inf->extract_response(*_rsa_private, new_key); if (ret != OKAY) { #ifdef DEBUG_ENCRYPTION_TENTACLE @@ -164,7 +164,7 @@ outcome encryption_tentacle::consume(infoton &to_chow, } else { // server's side need to process a key request and send it back using // the public key the requester provided. - blowfish_crypto agreed_key(blowfish_crypto::minimum_key_size()); + twofish_crypto agreed_key(twofish_crypto::minimum_key_size()); // initialized with junk. outcome worked = inf->prepare_blowfish_key(agreed_key); if (worked != OKAY) { diff --git a/octopi/library/tentacles/key_repository.cpp b/octopi/library/tentacles/key_repository.cpp index e5d0bc57..f81b14dd 100644 --- a/octopi/library/tentacles/key_repository.cpp +++ b/octopi/library/tentacles/key_repository.cpp @@ -14,7 +14,7 @@ #include "key_repository.h" -#include +#include #include using namespace basis; @@ -61,7 +61,7 @@ void key_repository::unlock(octenc_key_record *to_unlock) } outcome key_repository::add(const octopus_entity &ent, - const blowfish_crypto &key) + const twofish_crypto &key) { #ifdef DEBUG_KEY_REPOSITORY FUNCDEF("add"); diff --git a/octopi/library/tentacles/key_repository.h b/octopi/library/tentacles/key_repository.h index a373098b..76aead4c 100644 --- a/octopi/library/tentacles/key_repository.h +++ b/octopi/library/tentacles/key_repository.h @@ -16,7 +16,7 @@ \*****************************************************************************/ #include -#include +#include #include #include @@ -34,11 +34,11 @@ class octenc_key_record { public: octopus_entity _entity; //!< who the key belongs to. - crypto::blowfish_crypto _key; //!< used for communicating with an entity. + crypto::twofish_crypto _key; //!< used for communicating with an entity. octenc_key_record() : _key(200) {} //!< bogus blank constructor. - octenc_key_record(const octopus_entity &entity, const crypto::blowfish_crypto &key) + octenc_key_record(const octopus_entity &entity, const crypto::twofish_crypto &key) : _entity(entity), _key(key) {} }; @@ -59,7 +59,7 @@ public: void unlock(octenc_key_record *to_unlock); //!< drops the lock on the key record in "to_unlock". - basis::outcome add(const octopus_entity &ent, const crypto::blowfish_crypto &key); + basis::outcome add(const octopus_entity &ent, const crypto::twofish_crypto &key); //!< adds a "key" for the "ent". this will fail if one is already listed. basis::outcome whack(const octopus_entity &ent); -- 2.43.0