summaryrefslogtreecommitdiff
path: root/pppd/main.c
diff options
context:
space:
mode:
authorEivind Næss <eivnaes@yahoo.com>2022-08-03 08:46:28 -0700
committerEivind Næss <eivnaes@yahoo.com>2022-08-12 08:31:06 -0700
commit774440c7f0a2b633bae02980927e36ad371604dc (patch)
tree0fe509cdcfe247e89f96891be34d8b4b8fad4dc3 /pppd/main.c
parent8cbd7dd098cbb565dd9b01397fb352f1c98376f3 (diff)
downloadppp-774440c7f0a2b633bae02980927e36ad371604dc.tar.gz
Create a new API to abstract the crypto functions used by pppd.
This re-introduces the missing DES encryption functions copied from Openssl 3.0 project. Incorporates a new API for performing MD4/MD5/SHA and encryption using DES-ECB mode. Unit tests are included for respective digest/encryption functions using this new API. With this change, you can pass configure --without-openssl to use the internally provided functions. If you do have openssl, then it will default to use these functions. This also provides a framework to allow other vendors to provide crypto. This closes #333, partially addresses #242 (except the pkcs11 engine support). Word has it that openssl is working on support for this, and the libp11 / opensc project are inclined not to support this. Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
Diffstat (limited to 'pppd/main.c')
-rw-r--r--pppd/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pppd/main.c b/pppd/main.c
index 7e47752..8d5f32b 100644
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -109,6 +109,7 @@
#include "ccp.h"
#include "ecp.h"
#include "pathnames.h"
+#include "ppp-crypto.h"
#ifdef PPP_WITH_TDB
#include "tdb.h"
@@ -294,6 +295,8 @@ main(int argc, char *argv[])
struct protent *protp;
char numbuf[16];
+ PPP_crypto_init();
+
strlcpy(path_ipup, PPP_PATH_IPUP, MAXPATHLEN);
strlcpy(path_ipdown, PPP_PATH_IPDOWN, MAXPATHLEN);
@@ -581,6 +584,7 @@ main(int argc, char *argv[])
}
}
+ PPP_crypto_deinit();
die(status);
return 0;
}