diff options
author | tb <> | 2018-08-24 20:22:15 +0000 |
---|---|---|
committer | tb <> | 2018-08-24 20:22:15 +0000 |
commit | a5eaaaed8fa0896775f96cf6b57259dad576fec1 (patch) | |
tree | 0581e2b3e7d7f9b09ce2e06c0e79d8c1ad83479a | |
parent | 5ace4c7530c972572b51f65ce6521aa5fdded0bc (diff) | |
download | openbsd-a5eaaaed8fa0896775f96cf6b57259dad576fec1.tar.gz openbsd-a5eaaaed8fa0896775f96cf6b57259dad576fec1.tar.bz2 openbsd-a5eaaaed8fa0896775f96cf6b57259dad576fec1.zip |
Add consts to EVP_PKEY_asn1_set_private()
Requires adding a const to the priv_decode() member of
EVP_PKEY_ASN1_METHOD and adjusting all *_priv_decode()
functions. All this is already documented this way.
tested in a bulk build by sthen
ok jsing
-rw-r--r-- | src/lib/libcrypto/asn1/ameth_lib.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_locl.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_ameth.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_ameth.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/evp.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/gost/gostr341001_ameth.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_ameth.c | 4 |
8 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/libcrypto/asn1/ameth_lib.c b/src/lib/libcrypto/asn1/ameth_lib.c index 50d8735ea7..505e986970 100644 --- a/src/lib/libcrypto/asn1/ameth_lib.c +++ b/src/lib/libcrypto/asn1/ameth_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ameth_lib.c,v 1.18 2018/05/24 07:49:46 tb Exp $ */ | 1 | /* $OpenBSD: ameth_lib.c,v 1.19 2018/08/24 20:22:15 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -396,7 +396,7 @@ EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, | |||
396 | 396 | ||
397 | void | 397 | void |
398 | EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, | 398 | EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, |
399 | int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf), | 399 | int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf), |
400 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), | 400 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), |
401 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 401 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
402 | ASN1_PCTX *pctx)) | 402 | ASN1_PCTX *pctx)) |
diff --git a/src/lib/libcrypto/asn1/asn1_locl.h b/src/lib/libcrypto/asn1/asn1_locl.h index aa35f7b8fc..5ade6c7e3f 100644 --- a/src/lib/libcrypto/asn1/asn1_locl.h +++ b/src/lib/libcrypto/asn1/asn1_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1_locl.h,v 1.10 2017/08/27 01:39:26 beck Exp $ */ | 1 | /* $OpenBSD: asn1_locl.h,v 1.11 2018/08/24 20:22:15 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -86,7 +86,7 @@ struct evp_pkey_asn1_method_st { | |||
86 | int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 86 | int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
87 | ASN1_PCTX *pctx); | 87 | ASN1_PCTX *pctx); |
88 | 88 | ||
89 | int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf); | 89 | int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf); |
90 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk); | 90 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk); |
91 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 91 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
92 | ASN1_PCTX *pctx); | 92 | ASN1_PCTX *pctx); |
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c index 6c6b8455fe..5054d17a3f 100644 --- a/src/lib/libcrypto/dh/dh_ameth.c +++ b/src/lib/libcrypto/dh/dh_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_ameth.c,v 1.16 2018/08/24 20:17:33 tb Exp $ */ | 1 | /* $OpenBSD: dh_ameth.c,v 1.17 2018/08/24 20:22:15 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -180,7 +180,7 @@ err: | |||
180 | */ | 180 | */ |
181 | 181 | ||
182 | static int | 182 | static int |
183 | dh_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) | 183 | dh_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8) |
184 | { | 184 | { |
185 | const unsigned char *p, *pm; | 185 | const unsigned char *p, *pm; |
186 | int pklen, pmlen; | 186 | int pklen, pmlen; |
diff --git a/src/lib/libcrypto/dsa/dsa_ameth.c b/src/lib/libcrypto/dsa/dsa_ameth.c index 6c1062d975..26d81eed7b 100644 --- a/src/lib/libcrypto/dsa/dsa_ameth.c +++ b/src/lib/libcrypto/dsa/dsa_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_ameth.c,v 1.25 2018/08/24 20:17:33 tb Exp $ */ | 1 | /* $OpenBSD: dsa_ameth.c,v 1.26 2018/08/24 20:22:15 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -179,7 +179,7 @@ err: | |||
179 | * AlgorithmIdentifier the pubkey must be recalculated. | 179 | * AlgorithmIdentifier the pubkey must be recalculated. |
180 | */ | 180 | */ |
181 | static int | 181 | static int |
182 | dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) | 182 | dsa_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8) |
183 | { | 183 | { |
184 | const unsigned char *p, *pm; | 184 | const unsigned char *p, *pm; |
185 | int pklen, pmlen; | 185 | int pklen, pmlen; |
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index 0071826dea..04c068200f 100644 --- a/src/lib/libcrypto/ec/ec_ameth.c +++ b/src/lib/libcrypto/ec/ec_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_ameth.c,v 1.24 2018/08/24 20:17:33 tb Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.25 2018/08/24 20:22:15 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -232,7 +232,7 @@ eckey_pub_cmp(const EVP_PKEY * a, const EVP_PKEY * b) | |||
232 | } | 232 | } |
233 | 233 | ||
234 | static int | 234 | static int |
235 | eckey_priv_decode(EVP_PKEY * pkey, PKCS8_PRIV_KEY_INFO * p8) | 235 | eckey_priv_decode(EVP_PKEY * pkey, const PKCS8_PRIV_KEY_INFO * p8) |
236 | { | 236 | { |
237 | const unsigned char *p = NULL; | 237 | const unsigned char *p = NULL; |
238 | const void *pval; | 238 | const void *pval; |
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index 0ec0431bc7..1684b13e49 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.67 2018/08/24 19:45:11 tb Exp $ */ | 1 | /* $OpenBSD: evp.h,v 1.68 2018/08/24 20:22:15 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 | * |
@@ -1012,7 +1012,7 @@ void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, | |||
1012 | int (*pkey_size)(const EVP_PKEY *pk), | 1012 | int (*pkey_size)(const EVP_PKEY *pk), |
1013 | int (*pkey_bits)(const EVP_PKEY *pk)); | 1013 | int (*pkey_bits)(const EVP_PKEY *pk)); |
1014 | void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, | 1014 | void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, |
1015 | int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf), | 1015 | int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf), |
1016 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), | 1016 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), |
1017 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 1017 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
1018 | ASN1_PCTX *pctx)); | 1018 | ASN1_PCTX *pctx)); |
diff --git a/src/lib/libcrypto/gost/gostr341001_ameth.c b/src/lib/libcrypto/gost/gostr341001_ameth.c index 9b17b2e2c7..16295996dc 100644 --- a/src/lib/libcrypto/gost/gostr341001_ameth.c +++ b/src/lib/libcrypto/gost/gostr341001_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gostr341001_ameth.c,v 1.14 2018/08/24 20:17:33 tb Exp $ */ | 1 | /* $OpenBSD: gostr341001_ameth.c,v 1.15 2018/08/24 20:22:15 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
@@ -394,7 +394,7 @@ priv_print_gost01(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx) | |||
394 | } | 394 | } |
395 | 395 | ||
396 | static int | 396 | static int |
397 | priv_decode_gost01(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf) | 397 | priv_decode_gost01(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf) |
398 | { | 398 | { |
399 | const unsigned char *pkey_buf = NULL, *p = NULL; | 399 | const unsigned char *pkey_buf = NULL, *p = NULL; |
400 | int priv_len = 0; | 400 | int priv_len = 0; |
diff --git a/src/lib/libcrypto/rsa/rsa_ameth.c b/src/lib/libcrypto/rsa/rsa_ameth.c index ec8a71b7b9..ce3e9b3509 100644 --- a/src/lib/libcrypto/rsa/rsa_ameth.c +++ b/src/lib/libcrypto/rsa/rsa_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_ameth.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: rsa_ameth.c,v 1.19 2018/08/24 20:22:15 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -154,7 +154,7 @@ rsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | static int | 156 | static int |
157 | rsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) | 157 | rsa_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8) |
158 | { | 158 | { |
159 | const unsigned char *p; | 159 | const unsigned char *p; |
160 | int pklen; | 160 | int pklen; |