summaryrefslogtreecommitdiff
path: root/sys/src/ape/lib/openssl/demos/maurice/loadkeys.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-04-11 20:39:12 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-04-11 20:39:12 +0200
commit45f3c56a53334cc7614e1a5e55c938df4c7d5239 (patch)
tree9152c5f86720acd223effa3098bd99e213dfe14a /sys/src/ape/lib/openssl/demos/maurice/loadkeys.c
parent4e04698ab6fddc1efe41b97be54fcf120810bf5d (diff)
ape: removing openssl
Diffstat (limited to 'sys/src/ape/lib/openssl/demos/maurice/loadkeys.c')
-rw-r--r--sys/src/ape/lib/openssl/demos/maurice/loadkeys.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/sys/src/ape/lib/openssl/demos/maurice/loadkeys.c b/sys/src/ape/lib/openssl/demos/maurice/loadkeys.c
deleted file mode 100644
index 82fd22a95..000000000
--- a/sys/src/ape/lib/openssl/demos/maurice/loadkeys.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* NOCW */
-/*
- Please read the README file for condition of use, before
- using this software.
-
- Maurice Gittens <mgittens@gits.nl> January 1997
-
-*/
-
-#include <unistd.h>
-#include <stdio.h>
-#include <netinet/in.h>
-#include <fcntl.h>
-#include <strings.h>
-#include <stdlib.h>
-
-#include <openssl/rsa.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/x509.h>
-#include <openssl/err.h>
-#include <openssl/pem.h>
-#include <openssl/ssl.h>
-
-EVP_PKEY * ReadPublicKey(const char *certfile)
-{
- FILE *fp = fopen (certfile, "r");
- X509 *x509;
- EVP_PKEY *pkey;
-
- if (!fp)
- return NULL;
-
- x509 = PEM_read_X509(fp, NULL, 0, NULL);
-
- if (x509 == NULL)
- {
- ERR_print_errors_fp (stderr);
- return NULL;
- }
-
- fclose (fp);
-
- pkey=X509_extract_key(x509);
-
- X509_free(x509);
-
- if (pkey == NULL)
- ERR_print_errors_fp (stderr);
-
- return pkey;
-}
-
-EVP_PKEY *ReadPrivateKey(const char *keyfile)
-{
- FILE *fp = fopen(keyfile, "r");
- EVP_PKEY *pkey;
-
- if (!fp)
- return NULL;
-
- pkey = PEM_read_PrivateKey(fp, NULL, 0, NULL);
-
- fclose (fp);
-
- if (pkey == NULL)
- ERR_print_errors_fp (stderr);
-
- return pkey;
-}
-
-