From 8f0f5b69c0667900873738ce9bd37dbb1e6c28e8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 22 Apr 2021 17:59:16 +0100 Subject: [PATCH] Move key-generation code into its own subdir. Including mpunsafe.{h,c}, which should be an extra defence against inadvertently using it outside the keygen library. --- CMakeLists.txt | 3 +-- keygen/CMakeLists.txt | 10 ++++++++++ sshdssg.c => keygen/dsa.c | 0 sshecdsag.c => keygen/ecdsa.c | 0 millerrabin.c => keygen/millerrabin.c | 0 mpunsafe.c => keygen/mpunsafe.c | 0 mpunsafe.h => keygen/mpunsafe.h | 0 pockle.c => keygen/pockle.c | 0 sshprime.c => keygen/prime.c | 0 primecandidate.c => keygen/primecandidate.c | 0 sshrsag.c => keygen/rsa.c | 0 smallprimes.c => keygen/smallprimes.c | 0 12 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 keygen/CMakeLists.txt rename sshdssg.c => keygen/dsa.c (100%) rename sshecdsag.c => keygen/ecdsa.c (100%) rename millerrabin.c => keygen/millerrabin.c (100%) rename mpunsafe.c => keygen/mpunsafe.c (100%) rename mpunsafe.h => keygen/mpunsafe.h (100%) rename pockle.c => keygen/pockle.c (100%) rename sshprime.c => keygen/prime.c (100%) rename primecandidate.c => keygen/primecandidate.c (100%) rename sshrsag.c => keygen/rsa.c (100%) rename smallprimes.c => keygen/smallprimes.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b28c065..2a944fc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,9 +30,8 @@ add_library(network STATIC be_misc.c nullplug.c errsock.c proxy.c logging.c x11disp.c) add_library(keygen STATIC - millerrabin.c mpunsafe.c pockle.c primecandidate.c smallprimes.c - sshdssg.c sshecdsag.c sshprime.c sshrsag.c import.c) +add_subdirectory(keygen) add_library(agent STATIC sshpubk.c pageant.c aqsync.c) diff --git a/keygen/CMakeLists.txt b/keygen/CMakeLists.txt new file mode 100644 index 00000000..17eea2b1 --- /dev/null +++ b/keygen/CMakeLists.txt @@ -0,0 +1,10 @@ +add_sources_from_current_dir(keygen + dsa.c + ecdsa.c + millerrabin.c + mpunsafe.c + pockle.c + prime.c + primecandidate.c + rsa.c + smallprimes.c) diff --git a/sshdssg.c b/keygen/dsa.c similarity index 100% rename from sshdssg.c rename to keygen/dsa.c diff --git a/sshecdsag.c b/keygen/ecdsa.c similarity index 100% rename from sshecdsag.c rename to keygen/ecdsa.c diff --git a/millerrabin.c b/keygen/millerrabin.c similarity index 100% rename from millerrabin.c rename to keygen/millerrabin.c diff --git a/mpunsafe.c b/keygen/mpunsafe.c similarity index 100% rename from mpunsafe.c rename to keygen/mpunsafe.c diff --git a/mpunsafe.h b/keygen/mpunsafe.h similarity index 100% rename from mpunsafe.h rename to keygen/mpunsafe.h diff --git a/pockle.c b/keygen/pockle.c similarity index 100% rename from pockle.c rename to keygen/pockle.c diff --git a/sshprime.c b/keygen/prime.c similarity index 100% rename from sshprime.c rename to keygen/prime.c diff --git a/primecandidate.c b/keygen/primecandidate.c similarity index 100% rename from primecandidate.c rename to keygen/primecandidate.c diff --git a/sshrsag.c b/keygen/rsa.c similarity index 100% rename from sshrsag.c rename to keygen/rsa.c diff --git a/smallprimes.c b/keygen/smallprimes.c similarity index 100% rename from smallprimes.c rename to keygen/smallprimes.c