summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/demos/eay/base64.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-04-16 18:35:14 +0000
committertedu <tedu@openbsd.org>2014-04-16 18:35:14 +0000
commit3b6d1e39d63b84cd880dd908ad8efe1fc9aa53f4 (patch)
tree32478f30a546d3890772d75727312fb4cd4165ea /lib/libssl/src/demos/eay/base64.c
parentdelete a few leftovers (diff)
downloadwireguard-openbsd-3b6d1e39d63b84cd880dd908ad8efe1fc9aa53f4.tar.xz
wireguard-openbsd-3b6d1e39d63b84cd880dd908ad8efe1fc9aa53f4.zip
quoth the readme:
NOTE: Don't expect any of these programs to work with current OpenSSL releases, or even with later SSLeay releases. ok miod
Diffstat (limited to 'lib/libssl/src/demos/eay/base64.c')
-rw-r--r--lib/libssl/src/demos/eay/base64.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/libssl/src/demos/eay/base64.c b/lib/libssl/src/demos/eay/base64.c
deleted file mode 100644
index 4b8b0627d19..00000000000
--- a/lib/libssl/src/demos/eay/base64.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* This is a simple example of using the base64 BIO to a memory BIO and then
- * getting the data.
- */
-#include <stdio.h>
-#include <openssl/bio.h>
-#include <openssl/evp.h>
-
-main()
- {
- int i;
- BIO *mbio,*b64bio,*bio;
- char buf[512];
- char *p;
-
- mbio=BIO_new(BIO_s_mem());
- b64bio=BIO_new(BIO_f_base64());
-
- bio=BIO_push(b64bio,mbio);
- /* We now have bio pointing at b64->mem, the base64 bio encodes on
- * write and decodes on read */
-
- for (;;)
- {
- i=fread(buf,1,512,stdin);
- if (i <= 0) break;
- BIO_write(bio,buf,i);
- }
- /* We need to 'flush' things to push out the encoding of the
- * last few bytes. There is special encoding if it is not a
- * multiple of 3
- */
- BIO_flush(bio);
-
- printf("We have %d bytes available\n",BIO_pending(mbio));
-
- /* We will now get a pointer to the data and the number of elements. */
- /* hmm... this one was not defined by a macro in bio.h, it will be for
- * 0.9.1. The other option is too just read from the memory bio.
- */
- i=(int)BIO_ctrl(mbio,BIO_CTRL_INFO,0,(char *)&p);
-
- printf("%d\n",i);
- fwrite("---\n",1,4,stdout);
- fwrite(p,1,i,stdout);
- fwrite("---\n",1,4,stdout);
-
- /* This call will walk the chain freeing all the BIOs */
- BIO_free_all(bio);
- }