summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/man/EVP_EncryptInit.318
1 files changed, 14 insertions, 4 deletions
diff --git a/src/lib/libcrypto/man/EVP_EncryptInit.3 b/src/lib/libcrypto/man/EVP_EncryptInit.3
index c328edf4f6..478e80839e 100644
--- a/src/lib/libcrypto/man/EVP_EncryptInit.3
+++ b/src/lib/libcrypto/man/EVP_EncryptInit.3
@@ -1,5 +1,6 @@
1.\" $OpenBSD: EVP_EncryptInit.3,v 1.5 2016/12/25 22:15:10 schwarze Exp $ 1.\" $OpenBSD: EVP_EncryptInit.3,v 1.6 2017/08/20 18:41:39 schwarze Exp $
2.\" OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800 2.\" OpenSSL EVP_EncryptInit.pod 519a5d1e Jun 27 17:38:25 2017 -0700
3.\" OpenSSL EVP_EncryptInit.pod 5211e094 Nov 11 14:39:11 2014 -0800
3.\" 4.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 5.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2000-2002, 2005, 2012-2016 The OpenSSL Project. 6.\" Copyright (c) 2000-2002, 2005, 2012-2016 The OpenSSL Project.
@@ -49,7 +50,7 @@
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 52.\"
52.Dd $Mdocdate: December 25 2016 $ 53.Dd $Mdocdate: August 20 2017 $
53.Dt EVP_ENCRYPTINIT 3 54.Dt EVP_ENCRYPTINIT 3
54.Os 55.Os
55.Sh NAME 56.Sh NAME
@@ -113,6 +114,7 @@
113.Nm EVP_desx_cbc , 114.Nm EVP_desx_cbc ,
114.Nm EVP_rc4 , 115.Nm EVP_rc4 ,
115.Nm EVP_rc4_40 , 116.Nm EVP_rc4_40 ,
117.Nm EVP_rc4_hmac_md5 ,
116.Nm EVP_idea_cbc , 118.Nm EVP_idea_cbc ,
117.Nm EVP_idea_ecb , 119.Nm EVP_idea_ecb ,
118.Nm EVP_idea_cfb , 120.Nm EVP_idea_cfb ,
@@ -149,6 +151,8 @@
149.Nm EVP_aes_128_ccm , 151.Nm EVP_aes_128_ccm ,
150.Nm EVP_aes_192_ccm , 152.Nm EVP_aes_192_ccm ,
151.Nm EVP_aes_256_ccm , 153.Nm EVP_aes_256_ccm ,
154.Nm EVP_aes_128_cbc_hmac_sha1 ,
155.Nm EVP_aes_256_cbc_hmac_sha1 ,
152.Nm EVP_rc5_32_12_16_cbc , 156.Nm EVP_rc5_32_12_16_cbc ,
153.Nm EVP_rc5_32_12_16_cfb , 157.Nm EVP_rc5_32_12_16_cfb ,
154.Nm EVP_rc5_32_12_16_ecb , 158.Nm EVP_rc5_32_12_16_ecb ,
@@ -1074,7 +1078,7 @@ do_crypt(char *outfile)
1074 unsigned char key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; 1078 unsigned char key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
1075 unsigned char iv[] = {1,2,3,4,5,6,7,8}; 1079 unsigned char iv[] = {1,2,3,4,5,6,7,8};
1076 const char intext[] = "Some Crypto Text"; 1080 const char intext[] = "Some Crypto Text";
1077 EVP_CIPHER_CTX ctx; 1081 EVP_CIPHER_CTX *ctx;
1078 FILE *out; 1082 FILE *out;
1079 EVP_CIPHER_CTX_init(&ctx); 1083 EVP_CIPHER_CTX_init(&ctx);
1080 EVP_EncryptInit_ex(&ctx, EVP_bf_cbc(), NULL, key, iv); 1084 EVP_EncryptInit_ex(&ctx, EVP_bf_cbc(), NULL, key, iv);
@@ -1082,6 +1086,7 @@ do_crypt(char *outfile)
1082 if (!EVP_EncryptUpdate(&ctx, outbuf, &outlen, intext, 1086 if (!EVP_EncryptUpdate(&ctx, outbuf, &outlen, intext,
1083 strlen(intext))) { 1087 strlen(intext))) {
1084 /* Error */ 1088 /* Error */
1089 EVP_CIPHER_CTX_free(ctx);
1085 return 0; 1090 return 0;
1086 } 1091 }
1087 /* 1092 /*
@@ -1090,6 +1095,7 @@ do_crypt(char *outfile)
1090 */ 1095 */
1091 if (!EVP_EncryptFinal_ex(&ctx, outbuf + outlen, &tmplen)) { 1096 if (!EVP_EncryptFinal_ex(&ctx, outbuf + outlen, &tmplen)) {
1092 /* Error */ 1097 /* Error */
1098 EVP_CIPHER_CTX_free(ctx);
1093 return 0; 1099 return 0;
1094 } 1100 }
1095 outlen += tmplen; 1101 outlen += tmplen;
@@ -1101,6 +1107,10 @@ do_crypt(char *outfile)
1101 * NULs. 1107 * NULs.
1102 */ 1108 */
1103 out = fopen(outfile, "wb"); 1109 out = fopen(outfile, "wb");
1110 if (out == NULL) {
1111 /* Error */
1112 return 0;
1113 }
1104 fwrite(outbuf, 1, outlen, out); 1114 fwrite(outbuf, 1, outlen, out);
1105 fclose(out); 1115 fclose(out);
1106 return 1; 1116 return 1;