diff options
author | Ben Laurie <ben@openssl.org> | 1999-04-23 15:01:15 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 1999-04-23 15:01:15 +0000 |
commit | 61f5b6f33807306d09bccbc2dcad474d1d04ca40 (patch) | |
tree | 1680fa648df5f730df11ec433a512a1fadf0facd /crypto/dsa | |
parent | 779cc0bca98e35830db455f34b986b86a2d2f822 (diff) |
Work with -pedantic!
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/Makefile.ssl | 15 | ||||
-rw-r--r-- | crypto/dsa/dsa.h | 10 | ||||
-rw-r--r-- | crypto/dsa/dsa_sign.c | 4 | ||||
-rw-r--r-- | crypto/dsa/dsa_vrf.c | 5 | ||||
-rw-r--r-- | crypto/dsa/dsatest.c | 8 |
5 files changed, 23 insertions, 19 deletions
diff --git a/crypto/dsa/Makefile.ssl b/crypto/dsa/Makefile.ssl index 07620d5049..8f9dc77dea 100644 --- a/crypto/dsa/Makefile.ssl +++ b/crypto/dsa/Makefile.ssl @@ -94,23 +94,24 @@ dsa_asn1.o: ../../include/rc2.h ../../include/rc4.h ../../include/rc5.h dsa_asn1.o: ../../include/ripemd.h ../../include/rsa.h dsa_asn1.o: ../../include/safestack.h ../../include/sha.h ../../include/stack.h dsa_asn1.o: ../../include/x509.h ../../include/x509_vfy.h ../cryptlib.h -dsa_asn1.o: ../crypto.h ../opensslv.h dsa.h -dsa_err.o: ../../include/bn.h ../../include/err.h dsa.h +dsa_asn1.o: ../crypto.h ../opensslconf.h ../opensslv.h dsa.h +dsa_err.o: ../../include/bn.h ../../include/err.h ../opensslconf.h dsa.h dsa_gen.o: ../../include/bio.h ../../include/bn.h ../../include/buffer.h dsa_gen.o: ../../include/e_os.h ../../include/err.h ../../include/rand.h dsa_gen.o: ../../include/sha.h ../../include/stack.h ../cryptlib.h ../crypto.h -dsa_gen.o: ../opensslv.h dsa.h +dsa_gen.o: ../opensslconf.h ../opensslv.h dsa.h dsa_key.o: ../../include/bio.h ../../include/bn.h ../../include/buffer.h dsa_key.o: ../../include/e_os.h ../../include/err.h ../../include/rand.h dsa_key.o: ../../include/sha.h ../../include/stack.h ../cryptlib.h ../crypto.h -dsa_key.o: ../opensslv.h dsa.h +dsa_key.o: ../opensslconf.h ../opensslv.h dsa.h dsa_lib.o: ../../include/asn1.h ../../include/bio.h ../../include/bn.h dsa_lib.o: ../../include/buffer.h ../../include/e_os.h ../../include/err.h -dsa_lib.o: ../../include/stack.h ../cryptlib.h ../crypto.h ../opensslv.h dsa.h +dsa_lib.o: ../../include/stack.h ../cryptlib.h ../crypto.h ../opensslconf.h +dsa_lib.o: ../opensslv.h dsa.h dsa_sign.o: ../../include/asn1.h ../../include/bio.h ../../include/bn.h dsa_sign.o: ../../include/buffer.h ../../include/e_os.h ../../include/err.h dsa_sign.o: ../../include/rand.h ../../include/stack.h ../cryptlib.h -dsa_sign.o: ../crypto.h ../opensslv.h dsa.h +dsa_sign.o: ../crypto.h ../opensslconf.h ../opensslv.h dsa.h dsa_vrf.o: ../../include/asn1.h ../../include/asn1_mac.h ../../include/bio.h dsa_vrf.o: ../../include/blowfish.h ../../include/bn.h ../../include/buffer.h dsa_vrf.o: ../../include/cast.h ../../include/des.h ../../include/dh.h @@ -121,4 +122,4 @@ dsa_vrf.o: ../../include/rand.h ../../include/rc2.h ../../include/rc4.h dsa_vrf.o: ../../include/rc5.h ../../include/ripemd.h ../../include/rsa.h dsa_vrf.o: ../../include/safestack.h ../../include/sha.h ../../include/stack.h dsa_vrf.o: ../../include/x509.h ../../include/x509_vfy.h ../cryptlib.h -dsa_vrf.o: ../crypto.h ../opensslv.h dsa.h +dsa_vrf.o: ../crypto.h ../opensslconf.h ../opensslv.h dsa.h diff --git a/crypto/dsa/dsa.h b/crypto/dsa/dsa.h index d531efbb04..4d8aad63cf 100644 --- a/crypto/dsa/dsa.h +++ b/crypto/dsa/dsa.h @@ -121,17 +121,17 @@ void DSA_SIG_free(DSA_SIG *a); int i2d_DSA_SIG(DSA_SIG *a, unsigned char **pp); DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, unsigned char **pp, long length); -DSA_SIG * DSA_do_sign(unsigned char *dgst,int dlen,DSA *dsa); -int DSA_do_verify(unsigned char *dgst,int dgst_len, - DSA_SIG *sig,DSA *dsa); +DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa); +int DSA_do_verify(const unsigned char *dgst,int dgst_len, + DSA_SIG *sig,DSA *dsa); DSA * DSA_new(void); int DSA_size(DSA *); /* next 4 return -1 on error */ int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp); -int DSA_sign(int type,unsigned char *dgst,int dlen, +int DSA_sign(int type,const unsigned char *dgst,int dlen, unsigned char *sig, unsigned int *siglen, DSA *dsa); -int DSA_verify(int type,unsigned char *dgst,int dgst_len, +int DSA_verify(int type,const unsigned char *dgst,int dgst_len, unsigned char *sigbuf, int siglen, DSA *dsa); void DSA_free (DSA *r); diff --git a/crypto/dsa/dsa_sign.c b/crypto/dsa/dsa_sign.c index 9ceaceb632..f823e5dee3 100644 --- a/crypto/dsa/dsa_sign.c +++ b/crypto/dsa/dsa_sign.c @@ -65,7 +65,7 @@ #include "rand.h" #include "asn1.h" -DSA_SIG * DSA_do_sign(unsigned char *dgst, int dlen, DSA *dsa) +DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) { BIGNUM *kinv=NULL,*r=NULL,*s=NULL; BIGNUM m; @@ -132,7 +132,7 @@ err: /* unsigned char *sig: out */ /* unsigned int *siglen: out */ -int DSA_sign(int type, unsigned char *dgst, int dlen, unsigned char *sig, +int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, DSA *dsa) { DSA_SIG *s; diff --git a/crypto/dsa/dsa_vrf.c b/crypto/dsa/dsa_vrf.c index 24ede6762e..ca51ad2e5c 100644 --- a/crypto/dsa/dsa_vrf.c +++ b/crypto/dsa/dsa_vrf.c @@ -66,7 +66,8 @@ #include "asn1.h" #include "asn1_mac.h" -int DSA_do_verify(unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) +int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, + DSA *dsa) { BN_CTX *ctx; BIGNUM u1,u2,t1; @@ -143,7 +144,7 @@ int DSA_do_verify(unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) * 0: incorrect signature * -1: error */ -int DSA_verify(int type, unsigned char *dgst, int dgst_len, +int DSA_verify(int type, const unsigned char *dgst, int dgst_len, unsigned char *sigbuf, int siglen, DSA *dsa) { DSA_SIG *s; diff --git a/crypto/dsa/dsatest.c b/crypto/dsa/dsatest.c index 4018f81862..77b8cd800f 100644 --- a/crypto/dsa/dsatest.c +++ b/crypto/dsa/dsatest.c @@ -115,6 +115,8 @@ static unsigned char out_g[]={ 0xc5,0x72,0xaf,0x53,0xe6,0xd7,0x88,0x02, }; +static const unsigned char str1[]="12345678901234567890"; + static BIO *bio_err=NULL; int main(int argc, char **argv) @@ -124,7 +126,7 @@ int main(int argc, char **argv) unsigned char buf[256]; unsigned long h; unsigned char sig[256]; - int siglen; + unsigned int siglen; if (bio_err == NULL) bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); @@ -179,8 +181,8 @@ int main(int argc, char **argv) goto end; } DSA_generate_key(dsa); - DSA_sign(0, "12345678901234567890", 20, sig, &siglen, dsa); - if (DSA_verify(0, "12345678901234567890", 20, sig, siglen, dsa) == 1) + DSA_sign(0, str1, 20, sig, &siglen, dsa); + if (DSA_verify(0, str1, 20, sig, siglen, dsa) == 1) ret=1; end: if (!ret) |