提交 cb7fd76f 编写于 作者: D Dr. Stephen Henson

Modernise and fix (ancient) "maurice" demos.

上级 de822715
...@@ -130,7 +130,7 @@ void main_decrypt(void) ...@@ -130,7 +130,7 @@ void main_decrypt(void)
char ebuf[512]; char ebuf[512];
unsigned int buflen; unsigned int buflen;
EVP_CIPHER_CTX ectx; EVP_CIPHER_CTX ectx;
unsigned char iv[8]; unsigned char iv[EVP_MAX_IV_LENGTH];
unsigned char *encryptKey; unsigned char *encryptKey;
unsigned int ekeylen; unsigned int ekeylen;
EVP_PKEY *privateKey; EVP_PKEY *privateKey;
......
...@@ -31,9 +31,7 @@ EVP_PKEY * ReadPublicKey(const char *certfile) ...@@ -31,9 +31,7 @@ EVP_PKEY * ReadPublicKey(const char *certfile)
if (!fp) if (!fp)
return NULL; return NULL;
x509 = (X509 *)PEM_ASN1_read ((char *(*)())d2i_X509, x509 = PEM_read_X509(fp, NULL, 0, NULL);
PEM_STRING_X509,
fp, NULL, NULL);
if (x509 == NULL) if (x509 == NULL)
{ {
...@@ -61,10 +59,7 @@ EVP_PKEY *ReadPrivateKey(const char *keyfile) ...@@ -61,10 +59,7 @@ EVP_PKEY *ReadPrivateKey(const char *keyfile)
if (!fp) if (!fp)
return NULL; return NULL;
pkey = (EVP_PKEY*)PEM_ASN1_read ((char *(*)())d2i_PrivateKey, pkey = PEM_read_PrivateKey(fp, NULL, 0, NULL);
PEM_STRING_EVP_PKEY,
fp,
NULL, NULL);
fclose (fp); fclose (fp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册