Modernise and fix (ancient) "maurice" demos.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 28 Sep 2001 01:48:34 +0000 (01:48 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 28 Sep 2001 01:48:34 +0000 (01:48 +0000)
demos/maurice/example1.c
demos/maurice/loadkeys.c

index 0e70523a33666bdff6e1aaa80655c0dd5982d6d4..4890b69ce5a92b1a513150cfa664412fb85c412d 100644 (file)
@@ -130,7 +130,7 @@ void main_decrypt(void)
        char ebuf[512];
        unsigned int buflen;
         EVP_CIPHER_CTX ectx;
-        unsigned char iv[8];
+        unsigned char iv[EVP_MAX_IV_LENGTH];
        unsigned char *encryptKey; 
        unsigned int ekeylen; 
        EVP_PKEY *privateKey;
index 0f3464753af1f92b6fdbd27b484811e16cd06b5f..82fd22a950369c02aad71c0977e3c16a22c7bad5 100644 (file)
@@ -31,9 +31,7 @@ EVP_PKEY * ReadPublicKey(const char *certfile)
   if (!fp) 
      return NULL; 
 
-  x509 = (X509 *)PEM_ASN1_read ((char *(*)())d2i_X509,
-                                   PEM_STRING_X509,
-                                   fp, NULL, NULL);
+  x509 = PEM_read_X509(fp, NULL, 0, NULL);
 
   if (x509 == NULL) 
   {  
@@ -61,10 +59,7 @@ EVP_PKEY *ReadPrivateKey(const char *keyfile)
        if (!fp)
                return NULL;
 
-       pkey = (EVP_PKEY*)PEM_ASN1_read ((char *(*)())d2i_PrivateKey,
-                              PEM_STRING_EVP_PKEY,
-                              fp,
-                              NULL, NULL);
+       pkey = PEM_read_PrivateKey(fp, NULL, 0, NULL);
 
        fclose (fp);