From a58a6368383d55ab35ad4f4cdcb0f54310e7fd32 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 9 Apr 2006 20:53:19 +0000 Subject: [PATCH] Constification. --- crypto/evp/evp.h | 12 ++++++------ crypto/evp/evp_locl.h | 14 +++++++------- crypto/evp/pmeth_fn.c | 12 ++++++------ crypto/rsa/rsa_pmeth.c | 10 +++++----- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index e09c55377c..4bc42a4ef6 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -931,23 +931,23 @@ int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - unsigned char *tbs, int tbslen); + const unsigned char *tbs, int tbslen); int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, - unsigned char *sig, int siglen, - unsigned char *tbs, int tbslen); + const unsigned char *sig, int siglen, + const unsigned char *tbs, int tbslen); int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, unsigned char *rout, int *routlen, - unsigned char *sig, int siglen); + const unsigned char *sig, int siglen); int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - unsigned char *in, int inlen); + const unsigned char *in, int inlen); int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - unsigned char *in, int inlen); + const unsigned char *in, int inlen); /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_locl.h index 0fe4a09d0c..983dae7845 100644 --- a/crypto/evp/evp_locl.h +++ b/crypto/evp/evp_locl.h @@ -264,32 +264,32 @@ struct evp_pkey_method_st int (*sign_init)(EVP_PKEY_CTX *ctx); int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - unsigned char *tbs, int tbslen); + const unsigned char *tbs, int tbslen); int (*verify_init)(EVP_PKEY_CTX *ctx); - int (*verify)(EVP_PKEY_CTX *ctx, unsigned char *sig, int siglen, - unsigned char *tbs, int tbslen); + int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen, + const unsigned char *tbs, int tbslen); int (*verify_recover_init)(EVP_PKEY_CTX *ctx); int (*verify_recover)(EVP_PKEY_CTX *ctx, unsigned char *rout, int *routlen, - unsigned char *sig, int siglen); + const unsigned char *sig, int siglen); int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, EVP_MD_CTX *mctx); int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); - int (*verifyctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, int siglen, + int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig,int siglen, EVP_MD_CTX *mctx); int (*encrypt_init)(EVP_PKEY_CTX *ctx); int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - unsigned char *in, int inlen); + const unsigned char *in, int inlen); int (*decrypt_init)(EVP_PKEY_CTX *ctx); int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - unsigned char *in, int inlen); + const unsigned char *in, int inlen); int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value); diff --git a/crypto/evp/pmeth_fn.c b/crypto/evp/pmeth_fn.c index 2a7e4a73df..c7e21485e9 100644 --- a/crypto/evp/pmeth_fn.c +++ b/crypto/evp/pmeth_fn.c @@ -83,7 +83,7 @@ int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx) int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - unsigned char *tbs, int tbslen) + const unsigned char *tbs, int tbslen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->sign) { @@ -118,8 +118,8 @@ int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx) } int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, - unsigned char *sig, int siglen, - unsigned char *tbs, int tbslen) + const unsigned char *sig, int siglen, + const unsigned char *tbs, int tbslen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->verify) { @@ -155,7 +155,7 @@ int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx) int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, unsigned char *rout, int *routlen, - unsigned char *sig, int siglen) + const unsigned char *sig, int siglen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->verify_recover) { @@ -191,7 +191,7 @@ int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx) int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - unsigned char *in, int inlen) + const unsigned char *in, int inlen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->encrypt) { @@ -227,7 +227,7 @@ int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx) int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - unsigned char *in, int inlen) + const unsigned char *in, int inlen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->decrypt) { diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c index eec74ef7b9..a0db5ee2fa 100644 --- a/crypto/rsa/rsa_pmeth.c +++ b/crypto/rsa/rsa_pmeth.c @@ -65,7 +65,7 @@ extern int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, unsigned char *rm, unsigned int *prm_len, - unsigned char *sigbuf, unsigned int siglen, + const unsigned char *sigbuf, unsigned int siglen, RSA *rsa); /* RSA pkey context structure */ @@ -124,7 +124,7 @@ static void pkey_rsa_cleanup(EVP_PKEY_CTX *ctx) } static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - unsigned char *tbs, int tbslen) + const unsigned char *tbs, int tbslen) { int ret; RSA_PKEY_CTX *rctx = ctx->data; @@ -163,7 +163,7 @@ static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, static int pkey_rsa_verifyrecover(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - unsigned char *tbs, int tbslen) + const unsigned char *tbs, int tbslen) { int ret; RSA_PKEY_CTX *rctx = ctx->data; @@ -207,7 +207,7 @@ static int pkey_rsa_verifyrecover(EVP_PKEY_CTX *ctx, } static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - unsigned char *in, int inlen) + const unsigned char *in, int inlen) { int ret; RSA_PKEY_CTX *rctx = ctx->data; @@ -220,7 +220,7 @@ static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, } static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - unsigned char *in, int inlen) + const unsigned char *in, int inlen) { int ret; RSA_PKEY_CTX *rctx = ctx->data;