Changes between 0.9.3 and 0.9.3a [?] [xx May? 1999]
+ *) Updated some demos.
+ [Sean O Riordain]
+
*) Add missing BIO_free at exit of pkcs12 application.
[Wu Zhigang]
--- /dev/null
+CC=cc
+CFLAGS= -g -I../../include
+LIBS= -L../.. ../../libssl.a ../../libcrypto.a
+EXAMPLES=saccept sconnect
+
+all: $(EXAMPLES)
+
+saccept: saccept.o
+ $(CC) -o saccept saccept.o $(LIBS)
+
+sconnect: sconnect.o
+ $(CC) -o sconnect sconnect.o $(LIBS)
+
+clean:
+ rm -f $(EXAMPLES) *.o
+
*/
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
--- /dev/null
+CC=cc
+CFLAGS= -g -I../../include
+#LIBS= -L../.. -lcrypto -lssl
+LIBS= -L../.. ../../libssl.a ../../libcrypto.a
+
+# the file conn.c requires a file "proxy.h" which I couldn't find...
+#EXAMPLES=base64 conn loadrsa
+EXAMPLES=base64 loadrsa
+
+all: $(EXAMPLES)
+
+base64: base64.o
+ $(CC) -o base64 base64.o $(LIBS)
+#
+# sorry... can't find "proxy.h"
+#conn: conn.o
+# $(CC) -o conn conn.o $(LIBS)
+
+loadrsa: loadrsa.o
+ $(CC) -o loadrsa loadrsa.o $(LIBS)
+
+clean:
+ rm -f $(EXAMPLES) *.o
+
#include <stdlib.h>
#include <openssl/err.h>
#include <openssl/bio.h>
-#include "proxy.h"
+/* #include "proxy.h" */
extern int errno;
CC=cc
-CFLAGS= -g -I../../include
+CFLAGS= -g -I../../include -Wall
LIBS= -L../.. -lcrypto
EXAMPLES=example1 example2 example3 example4
clean:
rm -f $(EXAMPLES) *.o
+test: all
+ @echo
+ @echo Example 1 Demonstrates the sealing and opening APIs
+ @echo Doing the encrypt side...
+ ./example1 <README >t.t
+ @echo Doing the decrypt side...
+ ./example1 -d <t.t >t.2
+ diff t.2 README
+ rm -f t.t t.2
+ @echo example1 is OK
+
+ @echo
+ @echo Example2 Demonstrates rsa encryption and decryption
+ @echo and it should just print \"This the clear text\"
+ ./example2
+
+ @echo
+ @echo Example3 Demonstrates the use of symmetric block ciphers
+ @echo in this case it uses EVP_des_ede3_cbc
+ @echo i.e. triple DES in Cipher Block Chaining mode
+ @echo Doing the encrypt side...
+ ./example3 ThisIsThePassword <README >t.t
+ @echo Doing the decrypt side...
+ ./example3 -d ThisIsThePassword <t.t >t.2
+ diff t.2 README
+ rm -f t.t t.2
+ @echo example3 is OK
+
+ @echo
+ @echo Example4 Demonstrates base64 encoding and decoding
+ @echo Doing the encrypt side...
+ ./example4 <README >t.t
+ @echo Doing the decrypt side...
+ ./example4 -d <t.t >t.2
+ diff t.2 README
+ rm -f t.t t.2
+ @echo example4 is OK
EVP_PKEY *pubKey;
EVP_PKEY *privKey;
int len;
- FILE *fp;
ERR_load_crypto_strings();
EVP_PKEY_free(pubKey);
free(buf);
free(buf2);
+ return 0;
}
-
-
*/
#include <stdio.h>
+#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <evp.h>
+#include <openssl/evp.h>
#define STDIN 0
#define STDOUT 1
{
char buf[BUFLEN];
char ebuf[BUFLEN + 8];
- unsigned int ebuflen, rc;
+ unsigned int ebuflen; /* rc; */
unsigned char iv[EVP_MAX_IV_LENGTH], key[EVP_MAX_KEY_LENGTH];
- unsigned int ekeylen, net_ekeylen;
+ /* unsigned int ekeylen, net_ekeylen; */
EVP_CIPHER_CTX ectx;
memcpy(iv, INIT_VECTOR, sizeof(iv));
write(STDOUT, ebuf, ebuflen);
}
-
-
*/
#include <stdio.h>
+#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <evp.h>
+#include <openssl/evp.h>
#define STDIN 0
#define STDOUT 1
{
char buf[BUFLEN];
char ebuf[BUFLEN+24];
- unsigned int ebuflen, rc;
+ unsigned int ebuflen;
EVP_ENCODE_CTX ectx;
EVP_EncodeInit(&ectx);
{
char buf[BUFLEN];
char ebuf[BUFLEN+24];
- unsigned int ebuflen, rc;
+ unsigned int ebuflen;
EVP_ENCODE_CTX ectx;
EVP_DecodeInit(&ectx);
--- /dev/null
+CC=cc
+CFLAGS= -g -I../../include -Wall
+LIBS= -L../.. -lcrypto
+EXAMPLES=prime
+
+all: $(EXAMPLES)
+
+prime: prime.o
+ $(CC) -o prime prime.o $(LIBS)
+
+clean:
+ rm -f $(EXAMPLES) *.o
+
+test: all
+ @echo Test creating a 128-bit prime
+ ./prime 128
+ @echo Test creating a 256-bit prime
+ ./prime 256
+ @echo Test creating a 512-bit prime
+ ./prime 512
--- /dev/null
+CC=cc
+CFLAGS= -g -I../../include -Wall
+LIBS= -L../.. -lcrypto
+EXAMPLES=sign
+
+all: $(EXAMPLES)
+
+sign: sign.o
+ $(CC) -o sign sign.o $(LIBS)
+
+clean:
+ rm -f $(EXAMPLES) *.o
+
+test: all
+ ./sign
#include <openssl/pem.h>
#include <openssl/ssl.h>
-void main ()
+int main ()
{
int err;
int sig_len;
if (err != 1) { ERR_print_errors_fp (stderr); exit (1); }
EVP_PKEY_free (pkey);
printf ("Signature Verified Ok.\n");
+ return(0);
}