diff options
author | Simon L. B. Nielsen <simon@FreeBSD.org> | 2008-08-23 10:51:00 +0000 |
---|---|---|
committer | Simon L. B. Nielsen <simon@FreeBSD.org> | 2008-08-23 10:51:00 +0000 |
commit | c4a78426bef17a0a7c81195c2b2399e7441f14ad (patch) | |
tree | 596c39f00d5968b1519e8cd7f0546412b14c20f0 /crypto/openssl/demos/maurice/loadkeys.c | |
parent | a0ddfe4e7233d81e88a86217b7653708db2720fa (diff) | |
download | src-c4a78426bef17a0a7c81195c2b2399e7441f14ad.tar.gz src-c4a78426bef17a0a7c81195c2b2399e7441f14ad.zip |
Flatten OpenSSL vendor tree.
Notes
Notes:
svn path=/vendor-crypto/openssl/dist/; revision=182044
Diffstat (limited to 'crypto/openssl/demos/maurice/loadkeys.c')
-rw-r--r-- | crypto/openssl/demos/maurice/loadkeys.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/crypto/openssl/demos/maurice/loadkeys.c b/crypto/openssl/demos/maurice/loadkeys.c deleted file mode 100644 index 82fd22a95036..000000000000 --- a/crypto/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; -} - - |