summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2018-05-02 15:51:41 +0000
committertb <>2018-05-02 15:51:41 +0000
commit7f29a6625f497f02beaea0c30e17d4084e4851e5 (patch)
tree81ad224bb116b46338273c29efaaae67ff4051ac
parent66cfd2f5d49458fe9a3bb27319840e5bd209a81e (diff)
downloadopenbsd-7f29a6625f497f02beaea0c30e17d4084e4851e5.tar.gz
openbsd-7f29a6625f497f02beaea0c30e17d4084e4851e5.tar.bz2
openbsd-7f29a6625f497f02beaea0c30e17d4084e4851e5.zip
Add const qualifiers to return value of BIO_f_{base64,cipher,md}().
tested in bulk by sthen ok jsing
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c6
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c6
-rw-r--r--src/lib/libcrypto/evp/bio_md.c6
-rw-r--r--src/lib/libcrypto/evp/evp.h8
4 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index b54e8793ec..a13d26a884 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_b64.c,v 1.20 2015/02/07 13:19:15 doug Exp $ */ 1/* $OpenBSD: bio_b64.c,v 1.21 2018/05/02 15:51:41 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -91,7 +91,7 @@ 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 const BIO_METHOD methods_b64 = {
95 .type = BIO_TYPE_BASE64, 95 .type = BIO_TYPE_BASE64,
96 .name = "base64 encoding", 96 .name = "base64 encoding",
97 .bwrite = b64_write, 97 .bwrite = b64_write,
@@ -103,7 +103,7 @@ static BIO_METHOD methods_b64 = {
103 .callback_ctrl = b64_callback_ctrl 103 .callback_ctrl = b64_callback_ctrl
104}; 104};
105 105
106BIO_METHOD * 106const BIO_METHOD *
107BIO_f_base64(void) 107BIO_f_base64(void)
108{ 108{
109 return (&methods_b64); 109 return (&methods_b64);
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index 7c7cf9a8b3..712222a7cd 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_enc.c,v 1.20 2017/05/02 03:59:44 deraadt Exp $ */ 1/* $OpenBSD: bio_enc.c,v 1.21 2018/05/02 15:51:41 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -87,7 +87,7 @@ 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 const BIO_METHOD methods_enc = {
91 .type = BIO_TYPE_CIPHER, 91 .type = BIO_TYPE_CIPHER,
92 .name = "cipher", 92 .name = "cipher",
93 .bwrite = enc_write, 93 .bwrite = enc_write,
@@ -98,7 +98,7 @@ static BIO_METHOD methods_enc = {
98 .callback_ctrl = enc_callback_ctrl 98 .callback_ctrl = enc_callback_ctrl
99}; 99};
100 100
101BIO_METHOD * 101const BIO_METHOD *
102BIO_f_cipher(void) 102BIO_f_cipher(void)
103{ 103{
104 return (&methods_enc); 104 return (&methods_enc);
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c
index b1973746a7..44f72185dc 100644
--- a/src/lib/libcrypto/evp/bio_md.c
+++ b/src/lib/libcrypto/evp/bio_md.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_md.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */ 1/* $OpenBSD: bio_md.c,v 1.15 2018/05/02 15:51:41 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -74,7 +74,7 @@ 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 const BIO_METHOD methods_md = {
78 .type = BIO_TYPE_MD, 78 .type = BIO_TYPE_MD,
79 .name = "message digest", 79 .name = "message digest",
80 .bwrite = md_write, 80 .bwrite = md_write,
@@ -86,7 +86,7 @@ static BIO_METHOD methods_md = {
86 .callback_ctrl = md_callback_ctrl 86 .callback_ctrl = md_callback_ctrl
87}; 87};
88 88
89BIO_METHOD * 89const BIO_METHOD *
90BIO_f_md(void) 90BIO_f_md(void)
91{ 91{
92 return (&methods_md); 92 return (&methods_md);
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index e12e771cc5..817d4fb734 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/lib/libcrypto/evp/evp.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp.h,v 1.58 2018/02/20 18:05:28 tb Exp $ */ 1/* $OpenBSD: evp.h,v 1.59 2018/05/02 15:51:41 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -651,9 +651,9 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
651int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); 651int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);
652 652
653#ifndef OPENSSL_NO_BIO 653#ifndef OPENSSL_NO_BIO
654BIO_METHOD *BIO_f_md(void); 654const BIO_METHOD *BIO_f_md(void);
655BIO_METHOD *BIO_f_base64(void); 655const BIO_METHOD *BIO_f_base64(void);
656BIO_METHOD *BIO_f_cipher(void); 656const BIO_METHOD *BIO_f_cipher(void);
657void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, 657void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,
658 const unsigned char *i, int enc); 658 const unsigned char *i, int enc);
659#endif 659#endif