diff options
author | Matt Caswell <matt@openssl.org> | 2016-06-15 15:17:50 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-06-18 15:34:03 +0100 |
commit | 98370c2dd7dc32cecd7bb7d940383846fa435f25 (patch) | |
tree | c5f83ad8c892b93534e3079c925acba0a0103142 /include | |
parent | 7fb4b92c01bdef71543650ef7da6bfcec69f9cde (diff) |
constify SRP
Add const qualifiers to lots of SRP stuff. This started out as an effort
to silence some "type-punning" warnings on OpenBSD...but the fix was to
have proper const correctness in SRP.
RT4378
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/srp.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/include/openssl/srp.h b/include/openssl/srp.h index 1007b8321b..80bcb0dd38 100644 --- a/include/openssl/srp.h +++ b/include/openssl/srp.h @@ -52,8 +52,8 @@ typedef struct SRP_VBASE_st { STACK_OF(SRP_gN_cache) *gN_cache; /* to simulate a user */ char *seed_key; - BIGNUM *default_g; - BIGNUM *default_N; + const BIGNUM *default_g; + const BIGNUM *default_N; } SRP_VBASE; /* @@ -61,8 +61,8 @@ typedef struct SRP_VBASE_st { */ typedef struct SRP_gN_st { char *id; - BIGNUM *g; - BIGNUM *N; + const BIGNUM *g; + const BIGNUM *N; } SRP_gN; DEFINE_STACK_OF(SRP_gN) @@ -103,22 +103,23 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, # define DB_SRP_MODIF 'v' /* see srp.c */ -char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N); +char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N); SRP_gN *SRP_get_default_gN(const char *id); /* server side .... */ -BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, - BIGNUM *N); -BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v); -int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N); -BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N); +BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u, + const BIGNUM *b, const BIGNUM *N); +BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g, + const BIGNUM *v); +int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N); +BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N); /* client side .... */ -BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass); -BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g); -BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x, - BIGNUM *a, BIGNUM *u); -int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N); +BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass); +BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g); +BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g, + const BIGNUM *x, const BIGNUM *a, const BIGNUM *u); +int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N); # define SRP_MINIMAL_N 1024 |