summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp
diff options
context:
space:
mode:
authormiod <>2014-04-27 20:26:49 +0000
committermiod <>2014-04-27 20:26:49 +0000
commit45bb7f0ae87ddf787dd06d515db9afb04a74bf6c (patch)
tree319f4236c4f33e8d28d3d3a51c99e82d996e948f /src/lib/libcrypto/evp
parentcbbb78bcf8e4dca14564fbea5fdfe0703e2951cc (diff)
downloadopenbsd-45bb7f0ae87ddf787dd06d515db9afb04a74bf6c.tar.gz
openbsd-45bb7f0ae87ddf787dd06d515db9afb04a74bf6c.tar.bz2
openbsd-45bb7f0ae87ddf787dd06d515db9afb04a74bf6c.zip
Use C99 initializers for the various FOO_METHOD structs. More readable, and
avoid unreadable/unmaintainable constructs like that: const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = { EVP_PKEY_CMAC, EVP_PKEY_CMAC, 0, "CMAC", "OpenSSL CMAC method", 0,0,0,0, 0,0,0, cmac_size, 0, 0,0,0,0,0,0,0, cmac_key_free, 0, 0,0 }; ok matthew@ deraadt@
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c23
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c22
-rw-r--r--src/lib/libcrypto/evp/bio_md.c23
-rw-r--r--src/lib/libcrypto/evp/bio_ok.c22
4 files changed, 42 insertions, 48 deletions
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index 27fc587ca8..02631ec05a 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -91,18 +91,17 @@ typedef struct b64_struct
91 char tmp[B64_BLOCK_SIZE]; 91 char tmp[B64_BLOCK_SIZE];
92 } BIO_B64_CTX; 92 } BIO_B64_CTX;
93 93
94static BIO_METHOD methods_b64= 94static BIO_METHOD methods_b64= {
95 { 95 .type = BIO_TYPE_BASE64,
96 BIO_TYPE_BASE64,"base64 encoding", 96 .name = "base64 encoding",
97 b64_write, 97 .bwrite = b64_write,
98 b64_read, 98 .bread = b64_read,
99 b64_puts, 99 .bputs = b64_puts,
100 NULL, /* b64_gets, */ 100 .ctrl = b64_ctrl,
101 b64_ctrl, 101 .create = b64_new,
102 b64_new, 102 .destroy = b64_free,
103 b64_free, 103 .callback_ctrl = b64_callback_ctrl
104 b64_callback_ctrl, 104};
105 };
106 105
107BIO_METHOD *BIO_f_base64(void) 106BIO_METHOD *BIO_f_base64(void)
108 { 107 {
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index 8fe9a45e48..3362c25768 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -87,18 +87,16 @@ typedef struct enc_struct
87 char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2]; 87 char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2];
88 } BIO_ENC_CTX; 88 } BIO_ENC_CTX;
89 89
90static BIO_METHOD methods_enc= 90static BIO_METHOD methods_enc= {
91 { 91 .type = BIO_TYPE_CIPHER,
92 BIO_TYPE_CIPHER,"cipher", 92 .name = "cipher",
93 enc_write, 93 .bwrite = enc_write,
94 enc_read, 94 .bread = enc_read,
95 NULL, /* enc_puts, */ 95 .ctrl = enc_ctrl,
96 NULL, /* enc_gets, */ 96 .create = enc_new,
97 enc_ctrl, 97 .destroy = enc_free,
98 enc_new, 98 .callback_ctrl = enc_callback_ctrl
99 enc_free, 99};
100 enc_callback_ctrl,
101 };
102 100
103BIO_METHOD *BIO_f_cipher(void) 101BIO_METHOD *BIO_f_cipher(void)
104 { 102 {
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c
index 144fdfd56a..85eead6c95 100644
--- a/src/lib/libcrypto/evp/bio_md.c
+++ b/src/lib/libcrypto/evp/bio_md.c
@@ -74,18 +74,17 @@ static int md_new(BIO *h);
74static int md_free(BIO *data); 74static int md_free(BIO *data);
75static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp); 75static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
76 76
77static BIO_METHOD methods_md= 77static BIO_METHOD methods_md = {
78 { 78 .type = BIO_TYPE_MD,
79 BIO_TYPE_MD,"message digest", 79 .name = "message digest",
80 md_write, 80 .bwrite = md_write,
81 md_read, 81 .bread = md_read,
82 NULL, /* md_puts, */ 82 .bgets = md_gets,
83 md_gets, 83 .ctrl = md_ctrl,
84 md_ctrl, 84 .create = md_new,
85 md_new, 85 .destroy = md_free,
86 md_free, 86 .callback_ctrl = md_callback_ctrl
87 md_callback_ctrl, 87};
88 };
89 88
90BIO_METHOD *BIO_f_md(void) 89BIO_METHOD *BIO_f_md(void)
91 { 90 {
diff --git a/src/lib/libcrypto/evp/bio_ok.c b/src/lib/libcrypto/evp/bio_ok.c
index 09a762ffac..d0bcbc2bef 100644
--- a/src/lib/libcrypto/evp/bio_ok.c
+++ b/src/lib/libcrypto/evp/bio_ok.c
@@ -157,18 +157,16 @@ typedef struct ok_struct
157 unsigned char buf[IOBS]; 157 unsigned char buf[IOBS];
158 } BIO_OK_CTX; 158 } BIO_OK_CTX;
159 159
160static BIO_METHOD methods_ok= 160static BIO_METHOD methods_ok = {
161 { 161 .type = BIO_TYPE_CIPHER,
162 BIO_TYPE_CIPHER,"reliable", 162 .name = "reliable",
163 ok_write, 163 .bwrite = ok_write,
164 ok_read, 164 .bread = ok_read,
165 NULL, /* ok_puts, */ 165 .ctrl = ok_ctrl,
166 NULL, /* ok_gets, */ 166 .create = ok_new,
167 ok_ctrl, 167 .destroy = ok_free,
168 ok_new, 168 .callback_ctrl = ok_callback_ctrl
169 ok_free, 169};
170 ok_callback_ctrl,
171 };
172 170
173BIO_METHOD *BIO_f_reliable(void) 171BIO_METHOD *BIO_f_reliable(void)
174 { 172 {