Fix gcc 4.6 warnings. Check TLS server hello extension length.
authorBen Laurie <ben@openssl.org>
Sat, 12 Jun 2010 13:18:58 +0000 (13:18 +0000)
committerBen Laurie <ben@openssl.org>
Sat, 12 Jun 2010 13:18:58 +0000 (13:18 +0000)
54 files changed:
apps/apps.c
apps/dh.c
apps/dhparam.c
apps/dsaparam.c
apps/ec.c
apps/ecparam.c
apps/enc.c
apps/gendh.c
apps/gendsa.c
apps/genrsa.c
apps/pkcs7.c
apps/rand.c
apps/s_server.c
apps/s_socket.c
apps/speed.c
apps/x509.c
crypto/asn1/a_int.c
crypto/asn1/n_pkey.c
crypto/asn1/t_crl.c
crypto/asn1/tasn_dec.c
crypto/bio/bf_nbio.c
crypto/bio/bio_lib.c
crypto/bio/bss_acpt.c
crypto/bn/bn_mul.c
crypto/conf/conf_def.c
crypto/dsa/dsa_gen.c
crypto/ecdh/ech_lib.c
crypto/ecdsa/ecs_lib.c
crypto/evp/encode.c
crypto/hmac/hmac.c
crypto/ocsp/ocsp_prn.c
crypto/pem/pem_lib.c
crypto/pkcs7/pk7_doit.c
crypto/pkcs7/pk7_lib.c
crypto/pkcs7/pk7_mime.c
crypto/pqueue/pqueue.c
crypto/rand/randfile.c
crypto/x509/x509_vfy.c
engines/e_chil.c
engines/e_cswift.c
engines/e_ubsec.c
ssl/d1_clnt.c
ssl/d1_enc.c
ssl/d1_pkt.c
ssl/s23_lib.c
ssl/s2_srvr.c
ssl/s3_clnt.c
ssl/s3_enc.c
ssl/ssl_asn1.c
ssl/ssl_ciph.c
ssl/ssl_lib.c
ssl/ssltest.c
ssl/t1_enc.c
ssl/t1_lib.c

index ab60b700b0727545d9d8ff3a3ca312400cd869f9..a4b77e13e3ad47458b644b8e8d14da3af5fd66da 100644 (file)
@@ -351,13 +351,12 @@ void program_name(char *in, char *out, int size)
 
 int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
        {
-       int num,len,i;
+       int num,i;
        char *p;
 
        *argc=0;
        *argv=NULL;
 
-       len=strlen(buf);
        i=0;
        if (arg->count == 0)
                {
index c4d891e125ea1e3ed42145b6382b7423ecff4b43..7e45bd33563658d74b50ff880e5b431da2d83df1 100644 (file)
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -88,9 +88,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        DH *dh=NULL;
        int i,badops=0,text=0;
        BIO *in=NULL,*out=NULL;
@@ -189,7 +186,7 @@ bad:
        ERR_load_crypto_strings();
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        in=BIO_new(BIO_s_file());
index 04bd57c6e8aa22c16dadc9772ecc55484bcb6b2a..465cdfe77bfac05d4bbd0890d88b30d3522686d6 100644 (file)
@@ -149,9 +149,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        DH *dh=NULL;
        int i,badops=0,text=0;
 #ifndef OPENSSL_NO_DSA
@@ -270,7 +267,7 @@ bad:
        ERR_load_crypto_strings();
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        if (g && !num)
index 4305a739b33132645c41f8d644c9f962a784f83a..fe72c1d3dfa8fb5205143f589168c6199987f2b4 100644 (file)
@@ -111,9 +111,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        DSA *dsa=NULL;
        int i,badops=0,text=0;
        BIO *in=NULL,*out=NULL;
@@ -278,7 +275,7 @@ bad:
                }
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        if (need_rand)
@@ -357,12 +354,10 @@ bad:
        if (C)
                {
                unsigned char *data;
-               int l,len,bits_p,bits_q,bits_g;
+               int l,len,bits_p;
 
                len=BN_num_bytes(dsa->p);
                bits_p=BN_num_bits(dsa->p);
-               bits_q=BN_num_bits(dsa->q);
-               bits_g=BN_num_bits(dsa->g);
                data=(unsigned char *)OPENSSL_malloc(len+20);
                if (data == NULL)
                        {
index 771e15f3577c176031a24f5f5c6581802071082e..6b3d3ad91b484fc680849ebe6f075ac7a8225dee 100644 (file)
--- a/apps/ec.c
+++ b/apps/ec.c
@@ -85,9 +85,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
 {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE  *e = NULL;
-#endif
        int     ret = 1;
        EC_KEY  *eckey = NULL;
        const EC_GROUP *group;
@@ -254,7 +251,7 @@ bad:
        ERR_load_crypto_strings();
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) 
index 4e1fc837ed6aca2366287bf9e25bd616d7512130..2d3fd3032466c8b952320c473394b62bcc1d0f0a 100644 (file)
@@ -129,9 +129,6 @@ int MAIN(int argc, char **argv)
        char    *infile = NULL, *outfile = NULL, *prog;
        BIO     *in = NULL, *out = NULL;
        int     informat, outformat, noout = 0, C = 0, ret = 1;
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE  *e = NULL;
-#endif
        char    *engine = NULL;
 
        BIGNUM  *ec_p = NULL, *ec_a = NULL, *ec_b = NULL,
@@ -340,7 +337,7 @@ bad:
                }
 
 #ifndef OPENSSL_NO_ENGINE
-       e = setup_engine(bio_err, engine, 0);
+       setup_engine(bio_err, engine, 0);
 #endif
 
        if (list_curves)
index 8f5e5b89359fe3dc4ba3470c0c7a82943e208a39..8beb2dff35bee2be83337def4499ffe21c142244 100644 (file)
@@ -100,9 +100,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        static const char magic[]="Salted__";
        char mbuf[sizeof magic-1];
        char *strbuf=NULL;
@@ -311,7 +308,7 @@ bad:
                }
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        if (md && (dgst=EVP_get_digestbyname(md)) == NULL)
index 47497864b0024d8c774598a4bdf01a1cdc4f1151..346ea4a866066417d57c2a3ca8e6dd70c996c5ac 100644 (file)
@@ -89,9 +89,6 @@ int MAIN(int, char **);
 int MAIN(int argc, char **argv)
        {
        BN_GENCB cb;
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        DH *dh=NULL;
        int ret=1,num=DEFBITS;
        int g=2;
@@ -163,7 +160,7 @@ bad:
                }
                
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        out=BIO_new(BIO_s_file());
index 22c39629e5c4adfa0dca27eafc6568c0b60bcf33..62ea977905103e7c7baf469d8c5978e44b81ac4f 100644 (file)
@@ -78,9 +78,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        DSA *dsa=NULL;
        int ret=1;
        char *outfile=NULL;
@@ -206,7 +203,7 @@ bad:
                }
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
index 5759acbf9bbe078349a430d06803b13c9d54fb21..dfb01399e0ef5ce2ac215e6ad46f0988b73caf5a 100644 (file)
@@ -89,9 +89,6 @@ int MAIN(int, char **);
 int MAIN(int argc, char **argv)
        {
        BN_GENCB cb;
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        int ret=1;
        int i,num=DEFBITS;
        long l;
@@ -235,7 +232,7 @@ bad:
        }
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        if (outfile == NULL)
index da4dbe7a07c0706a223784f2143495fd414a9f58..bdbb10229eecc12be4d66de4d5e2418f1826b444 100644 (file)
@@ -82,9 +82,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        PKCS7 *p7=NULL;
        int i,badops=0;
        BIO *in=NULL,*out=NULL;
@@ -180,7 +177,7 @@ bad:
        ERR_load_crypto_strings();
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        in=BIO_new(BIO_s_file());
index 44a1d46a03cdcdb48116fcfefa2c06300a8cee05..790e79592c1ea92e91def9d89358d2b2515e826d 100644 (file)
@@ -77,9 +77,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        int i, r, ret = 1;
        int badopt;
        char *outfile = NULL;
@@ -178,7 +175,7 @@ int MAIN(int argc, char **argv)
                }
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        app_RAND_load_file(NULL, bio_err, (inrand != NULL));
index 88b308ca388f397221c0302f9336479f4e938029..9ef643e2b4df733710f42e61686e62dc65585599 100644 (file)
@@ -2075,12 +2075,14 @@ static int www_body(char *hostname, int s, unsigned char *context)
        {
        char *buf=NULL;
        int ret=1;
-       int i,j,k,blank,dot;
+       int i,j,k,dot;
        struct stat st_buf;
        SSL *con;
        SSL_CIPHER *c;
        BIO *io,*ssl_bio,*sbio;
+#ifdef RENEG
        long total_bytes;
+#endif
 
        buf=OPENSSL_malloc(bufsize);
        if (buf == NULL) return(0);
@@ -2151,7 +2153,6 @@ static int www_body(char *hostname, int s, unsigned char *context)
                SSL_set_msg_callback_arg(con, bio_s_out);
                }
 
-       blank=0;
        for (;;)
                {
                if (hack)
@@ -2388,7 +2389,9 @@ static int www_body(char *hostname, int s, unsigned char *context)
                                         BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n");
                                 }
                        /* send the file */
+#ifdef RENEG
                        total_bytes=0;
+#endif
                        for (;;)
                                {
                                i=BIO_read(file,buf,bufsize);
index cf823585355fc8c1fb4685bdd867e9f282cf2b73..2a57577b09258b1cd7b948fd1920a9afefed67a5 100644 (file)
@@ -329,7 +329,7 @@ static int init_server_long(int *sock, int port, char *ip, int type)
        {
        int ret=0;
        struct sockaddr_in server;
-       int s= -1,i;
+       int s= -1;
 
        if (!ssl_sock_init()) return(0);
 
@@ -368,7 +368,6 @@ static int init_server_long(int *sock, int port, char *ip, int type)
                }
        /* Make it 128 for linux */
        if (type==SOCK_STREAM && listen(s,128) == -1) goto err;
-       i=0;
        *sock=s;
        ret=1;
 err:
@@ -386,7 +385,7 @@ static int init_server(int *sock, int port, int type)
 
 static int do_accept(int acc_sock, int *sock, char **host)
        {
-       int ret,i;
+       int ret;
        struct hostent *h1,*h2;
        static struct sockaddr_in from;
        int len;
@@ -463,7 +462,6 @@ redoit:
                        BIO_printf(bio_err,"gethostbyname failure\n");
                        return(0);
                        }
-               i=0;
                if (h2->h_addrtype != AF_INET)
                        {
                        BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
index 393a7baade3833693a93b7b697963ef0e90e9dc1..d206c96e29a3a5fdd9edbd6a5f62e8c69626591c 100644 (file)
@@ -500,9 +500,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        unsigned char *buf=NULL,*buf2=NULL;
        int mret=1;
        long count=0,save_count=0;
@@ -593,7 +590,6 @@ int MAIN(int argc, char **argv)
        unsigned char DES_iv[8];
        unsigned char iv[2*MAX_BLOCK_SIZE/8];
 #ifndef OPENSSL_NO_DES
-       DES_cblock *buf_as_des_cblock = NULL;
        static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
        static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
        static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
@@ -806,9 +802,6 @@ int MAIN(int argc, char **argv)
                BIO_printf(bio_err,"out of memory\n");
                goto end;
                }
-#ifndef OPENSSL_NO_DES
-       buf_as_des_cblock = (DES_cblock *)buf;
-#endif
        if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)
                {
                BIO_printf(bio_err,"out of memory\n");
@@ -883,7 +876,7 @@ int MAIN(int argc, char **argv)
                                BIO_printf(bio_err,"no engine given\n");
                                goto end;
                                }
-                        e = setup_engine(bio_err, *argv, 0);
+                        setup_engine(bio_err, *argv, 0);
                        /* j will be increased again further down.  We just
                           don't want speed to confuse an engine with an
                           algorithm, especially when none is given (which
index b25508aa8ed3db166714e21c7dfddcfc26c2cfa2..151d3a91a724e3bad49678d79d07e83e09a8d0b4 100644 (file)
@@ -539,7 +539,6 @@ bad:
        if (reqfile)
                {
                EVP_PKEY *pkey;
-               X509_CINF *ci;
                BIO *in;
 
                if (!sign_flag && !CA_flag)
@@ -607,7 +606,6 @@ bad:
                print_name(bio_err, "subject=", X509_REQ_get_subject_name(req), nmflag);
 
                if ((x=X509_new()) == NULL) goto end;
-               ci=x->cert_info;
 
                if (sno == NULL)
                        {
index f8d198efb16068b04a3fbd80082c77275b7d4f75..f551bdbaadd3ec3c458a13e6f926491391375cf9 100644 (file)
@@ -273,7 +273,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
        {
        ASN1_INTEGER *ret=NULL;
        const unsigned char *p;
-       unsigned char *to,*s;
+       unsigned char *s;
        long len;
        int inf,tag,xclass;
        int i;
@@ -308,7 +308,6 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
                i=ERR_R_MALLOC_FAILURE;
                goto err;
                }
-       to=s;
        ret->type=V_ASN1_INTEGER;
        if(len) {
                if ((*p == 0) && (len != 1))
index 60bc437938cfec3d07c692d48064cebc0864acc7..e7d04390625b16dff3df9c8e2b755e474a743d83 100644 (file)
@@ -242,7 +242,7 @@ RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
                 int sgckey)
        {
        RSA *ret=NULL;
-       const unsigned char *p, *kp;
+       const unsigned char *p;
        NETSCAPE_ENCRYPTED_PKEY *enckey = NULL;
 
        p = *pp;
@@ -265,7 +265,6 @@ RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
                ASN1err(ASN1_F_D2I_RSA_NET,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM);
                goto err;
        }
-       kp = enckey->enckey->digest->data;
        if (cb == NULL)
                cb=EVP_read_pw_string;
        if ((ret=d2i_RSA_NET_2(a, enckey->enckey->digest,cb, sgckey)) == NULL) goto err;
index bdb244c015bd03a520ce79d5dcf8ad94186df9b3..ee5a687ce83a94b41fbba5c367b2c54bb6e8cf3a 100644 (file)
@@ -87,7 +87,7 @@ int X509_CRL_print(BIO *out, X509_CRL *x)
        STACK_OF(X509_REVOKED) *rev;
        X509_REVOKED *r;
        long l;
-       int i, n;
+       int i;
        char *p;
 
        BIO_printf(out, "Certificate Revocation List (CRL):\n");
@@ -107,7 +107,6 @@ int X509_CRL_print(BIO *out, X509_CRL *x)
        else BIO_printf(out,"NONE");
        BIO_printf(out,"\n");
 
-       n=X509_CRL_get_ext_count(x);
        X509V3_extensions_print(out, "CRL extensions",
                                                x->crl->extensions, 0, 8);
 
index 48bc1c0d4d090be4c43fa6910b907157a05b5fad..a228c0d6cd1619f8ed90c9db9d29556311a82f42 100644 (file)
@@ -166,7 +166,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
        int i;
        int otag;
        int ret = 0;
-       ASN1_VALUE *pchval, **pchptr, *ptmpval;
+       ASN1_VALUE **pchptr, *ptmpval;
        if (!pval)
                return 0;
        if (aux && aux->asn1_cb)
@@ -317,7 +317,6 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
                        goto err;
                        }
                /* CHOICE type, try each possibility in turn */
-               pchval = NULL;
                p = *in;
                for (i = 0, tt=it->templates; i < it->tcount; i++, tt++)
                        {
index c72a23c2e1b289417543fb372f90a5a3a86115e8..028616c06481c4f1049cb147c80eea919bb4d201 100644 (file)
@@ -125,7 +125,6 @@ static int nbiof_free(BIO *a)
        
 static int nbiof_read(BIO *b, char *out, int outl)
        {
-       NBIO_TEST *nt;
        int ret=0;
 #if 1
        int num;
@@ -134,7 +133,6 @@ static int nbiof_read(BIO *b, char *out, int outl)
 
        if (out == NULL) return(0);
        if (b->next_bio == NULL) return(0);
-       nt=(NBIO_TEST *)b->ptr;
 
        BIO_clear_retry_flags(b);
 #if 1
index 3f52ae953c2946b88e6d04c360aa52a4c2b631f7..371cdf52cb066f21c5b57ddc453aa29dab8f9593 100644 (file)
@@ -110,7 +110,7 @@ int BIO_set(BIO *bio, BIO_METHOD *method)
 
 int BIO_free(BIO *a)
        {
-       int ret=0,i;
+       int i;
 
        if (a == NULL) return(0);
 
@@ -133,7 +133,7 @@ int BIO_free(BIO *a)
        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
 
        if ((a->method == NULL) || (a->method->destroy == NULL)) return(1);
-       ret=a->method->destroy(a);
+       a->method->destroy(a);
        OPENSSL_free(a);
        return(1);
        }
index d090b7272fb69d51d6189217f41071ab2d5880d0..e7fb892eaa2b4247ef8fcc5704667ad14732d510 100644 (file)
@@ -340,7 +340,6 @@ static int acpt_write(BIO *b, const char *in, int inl)
 
 static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
-       BIO *dbio;
        int *ip;
        long ret=1;
        BIO_ACCEPT *data;
@@ -437,8 +436,8 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
                ret=(long)data->bind_mode;
                break;
        case BIO_CTRL_DUP:
-               dbio=(BIO *)ptr;
-/*             if (data->param_port) EAY EAY
+/*             dbio=(BIO *)ptr;
+               if (data->param_port) EAY EAY
                        BIO_set_port(dbio,data->param_port);
                if (data->param_hostname)
                        BIO_set_hostname(dbio,data->param_hostname);
index a0e9ec3b4694cb896a565f2953c56f53eef1da1c..12e5be80eb2b442db28f6b1955c0d583bb91bb83 100644 (file)
@@ -551,7 +551,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
             int tna, int tnb, BN_ULONG *t)
        {
        int i,j,n2=n*2;
-       int c1,c2,neg,zero;
+       int c1,c2,neg;
        BN_ULONG ln,lo,*p;
 
 # ifdef BN_COUNT
@@ -567,7 +567,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
        /* r=(a[0]-a[1])*(b[1]-b[0]) */
        c1=bn_cmp_part_words(a,&(a[n]),tna,n-tna);
        c2=bn_cmp_part_words(&(b[n]),b,tnb,tnb-n);
-       zero=neg=0;
+       neg=0;
        switch (c1*3+c2)
                {
        case -4:
@@ -575,7 +575,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
                bn_sub_part_words(&(t[n]),b,      &(b[n]),tnb,n-tnb); /* - */
                break;
        case -3:
-               zero=1;
                /* break; */
        case -2:
                bn_sub_part_words(t,      &(a[n]),a,      tna,tna-n); /* - */
@@ -585,7 +584,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
        case -1:
        case 0:
        case 1:
-               zero=1;
                /* break; */
        case 2:
                bn_sub_part_words(t,      a,      &(a[n]),tna,n-tna); /* + */
@@ -593,7 +591,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
                neg=1;
                break;
        case 3:
-               zero=1;
                /* break; */
        case 4:
                bn_sub_part_words(t,      a,      &(a[n]),tna,n-tna);
@@ -1012,7 +1009,6 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
                {
                if (i >= -1 && i <= 1)
                        {
-                       int sav_j =0;
                        /* Find out the power of two lower or equal
                           to the longest of the two numbers */
                        if (i >= 0)
@@ -1023,7 +1019,6 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
                                {
                                j = BN_num_bits_word((BN_ULONG)bl);
                                }
-                       sav_j = j;
                        j = 1<<(j-1);
                        assert(j <= al || j <= bl);
                        k = j+j;
index d8bce8732a2ddff20d978ce9f49c8c3c95ba1d18..3c58936d9928b23b58a4905a983c0674dbda8753 100644 (file)
@@ -213,13 +213,14 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
        int bufnum=0,i,ii;
        BUF_MEM *buff=NULL;
        char *s,*p,*end;
-       int again,n;
+       int again;
        long eline=0;
        char btmp[DECIMAL_SIZE(eline)+1];
        CONF_VALUE *v=NULL,*tv;
        CONF_VALUE *sv=NULL;
        char *section=NULL,*buf;
-       STACK_OF(CONF_VALUE) *section_sk=NULL,*ts;
+/*     STACK_OF(CONF_VALUE) *section_sk=NULL;*/
+/*     STACK_OF(CONF_VALUE) *ts=NULL;*/
        char *start,*psection,*pname;
        void *h = (void *)(conf->data);
 
@@ -250,7 +251,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
                                        CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
                goto err;
                }
-       section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
+/*     section_sk=(STACK_OF(CONF_VALUE) *)sv->value;*/
 
        bufnum=0;
        again=0;
@@ -309,7 +310,6 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
                buf=buff->data;
 
                clear_comments(conf, buf);
-               n=strlen(buf);
                s=eat_ws(conf, buf);
                if (IS_EOF(conf,*s)) continue; /* blank line */
                if (*s == '[')
@@ -343,7 +343,7 @@ again:
                                        CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
                                goto err;
                                }
-                       section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
+/*                     section_sk=(STACK_OF(CONF_VALUE) *)sv->value;*/
                        continue;
                        }
                else
@@ -406,12 +406,12 @@ again:
                                           CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
                                        goto err;
                                        }
-                               ts=(STACK_OF(CONF_VALUE) *)tv->value;
+/*                             ts=(STACK_OF(CONF_VALUE) *)tv->value;*/
                                }
                        else
                                {
                                tv=sv;
-                               ts=section_sk;
+/*                             ts=section_sk;*/
                                }
 #if 1
                        if (_CONF_add_string(conf, tv, v) == 0)
@@ -465,9 +465,6 @@ err:
 
 static void clear_comments(CONF *conf, char *p)
        {
-       char *to;
-
-       to=p;
        for (;;)
                {
                if (IS_FCOMMENT(conf,*p))
index 6f1728e3cf0036958f12ba3e024d1697bbbe664e..7a9d1881cc481eddd44b1fa13f9f608570f460f4 100644 (file)
@@ -110,7 +110,7 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,
        BIGNUM *r0,*W,*X,*c,*test;
        BIGNUM *g=NULL,*q=NULL,*p=NULL;
        BN_MONT_CTX *mont=NULL;
-       int k,n=0,i,b,m=0;
+       int k,n=0,i,m=0;
        int counter=0;
        int r=0;
        BN_CTX *ctx=NULL;
@@ -211,7 +211,6 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,
                /* "offset = 2" */
 
                n=(bits-1)/160;
-               b=(bits-1)-n*160;
 
                for (;;)
                        {
index e89b1d477287ae47956fd48b02cfb0d1f5e4cbfe..bf22234778520810da9b47cf6f18246ed415d5ae 100644 (file)
@@ -96,7 +96,6 @@ const ECDH_METHOD *ECDH_get_default_method(void)
 
 int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth)
        {
-       const ECDH_METHOD *mtmp;
        ECDH_DATA *ecdh;
 
        ecdh = ecdh_check(eckey);
@@ -104,11 +103,6 @@ int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth)
        if (ecdh == NULL)
                return 0;
 
-        mtmp = ecdh->meth;
-#if 0
-        if (mtmp->finish)
-               mtmp->finish(eckey);
-#endif
 #ifndef OPENSSL_NO_ENGINE
        if (ecdh->engine)
                {
index 85e8a3a7ed9bbfad36d7b409b2e37f4d29090ae0..2ebae3aa27d7fe7b563c5c41b20a0bdf3dfc7e20 100644 (file)
@@ -83,7 +83,6 @@ const ECDSA_METHOD *ECDSA_get_default_method(void)
 
 int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth)
 {
-        const ECDSA_METHOD *mtmp;
        ECDSA_DATA *ecdsa;
 
        ecdsa = ecdsa_check(eckey);
@@ -91,7 +90,6 @@ int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth)
        if (ecdsa == NULL)
                return 0;
 
-        mtmp = ecdsa->meth;
 #ifndef OPENSSL_NO_ENGINE
        if (ecdsa->engine)
        {
index 5921f0d710d8faed65c203cf180a7a4b320facb8..e8a521814a5ccfbc00efb0127d97e85629386465 100644 (file)
@@ -235,7 +235,7 @@ void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
 int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
             const unsigned char *in, int inl)
        {
-       int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl;
+       int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,exp_nl;
        unsigned char *d;
 
        n=ctx->num;
@@ -319,7 +319,6 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
                         * lines.  We process the line and then need to
                         * accept the '\n' */
                        if ((v != B64_EOF) && (n >= 64)) exp_nl=1;
-                       tmp2=v;
                        if (n > 0)
                                {
                                v=EVP_DecodeBlock(out,d,n);
index cbc1c76a57b3d7b56d9ab12819993326840b043e..6899be63d4fb96dd19ed6b7181d59c2796181dc7 100644 (file)
@@ -130,12 +130,9 @@ void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len)
 
 void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len)
        {
-       int j;
        unsigned int i;
        unsigned char buf[EVP_MAX_MD_SIZE];
 
-       j=EVP_MD_block_size(ctx->md);
-
        EVP_DigestFinal_ex(&ctx->md_ctx,buf,&i);
        EVP_MD_CTX_copy_ex(&ctx->md_ctx,&ctx->o_ctx);
        EVP_DigestUpdate(&ctx->md_ctx,buf,i);
index 90dd1aa38ed4b60833f154e3c2bb45010a26247b..b8b7871d0a8cb06c1cdf5155336e535ea256367f 100644 (file)
@@ -182,7 +182,6 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags)
         {
        int i, ret = 0;
        long l;
-       unsigned char *p;
        OCSP_CERTID *cid = NULL;
        OCSP_BASICRESP *br = NULL;
        OCSP_RESPID *rid = NULL;
@@ -207,7 +206,6 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags)
                return 1;
                }
 
-       p = ASN1_STRING_data(rb->response);
        i = ASN1_STRING_length(rb->response);
        if (!(br = OCSP_response_get1_basic(o))) goto err;
        rd = br->tbsResponseData;
index cbafefe416e1d9a8e255831e352affab77f28303..22bb791bcee4934d23cba934ff064904a4607c8b 100644 (file)
@@ -434,7 +434,6 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen,
 
 int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
        {
-       int o;
        const EVP_CIPHER *enc=NULL;
        char *p,c;
        char **header_pp = &header;
@@ -474,7 +473,6 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
                header++;
                }
        *header='\0';
-       o=OBJ_sn2nid(p);
        cipher->cipher=enc=EVP_get_cipherbyname(p);
        *header=c;
        header++;
index a03d7ebedf190ffd4ee1c62461a8fd11e65fa5d2..c8f1eb1b458959066c42ab8a1012a6c8eacf4c2e 100644 (file)
@@ -342,7 +342,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
        X509_ALGOR *enc_alg=NULL;
        STACK_OF(X509_ALGOR) *md_sk=NULL;
        STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL;
-       X509_ALGOR *xalg=NULL;
        PKCS7_RECIP_INFO *ri=NULL;
 
        i=OBJ_obj2nid(p7->type);
@@ -365,7 +364,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
                        PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE);
                        goto err;
                        }
-               xalg=p7->d.signed_and_enveloped->enc_data->algorithm;
                break;
        case NID_pkcs7_enveloped:
                rsk=p7->d.enveloped->recipientinfo;
@@ -377,7 +375,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
                        PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE);
                        goto err;
                        }
-               xalg=p7->d.enveloped->enc_data->algorithm;
                break;
        default:
                PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CONTENT_TYPE);
index f2490941a34d5176ed88b7910e320c48b74e73c7..898cddad0797546d35790ca814e899cd44442baa 100644 (file)
@@ -558,7 +558,6 @@ X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si)
 int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
        {
        int i;
-       ASN1_OBJECT *objtmp;
        PKCS7_ENC_CONTENT *ec;
 
        i=OBJ_obj2nid(p7->type);
@@ -581,7 +580,6 @@ int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
                PKCS7err(PKCS7_F_PKCS7_SET_CIPHER,PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
                return(0);
        }
-       objtmp = OBJ_nid2obj(i);
 
        ec->cipher = cipher;
        return 1;
index 7762d647ca70023b653181ce5cfdf98b9f5009f8..831b47d230b7708d46d4c93d75c5e01bb57e629a 100644 (file)
@@ -73,7 +73,6 @@ static int pk7_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
        {
        PKCS7 *p7 = (PKCS7 *)val;
        BIO *tmpbio, *p7bio;
-       int r = 0;
 
        if (!(flags & SMIME_DETACHED))
                {
@@ -95,8 +94,6 @@ static int pk7_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
        if (PKCS7_dataFinal(p7, p7bio) <= 0)
                goto err;
 
-       r = 1;
-
        err:
 
        /* Now remove any digests prepended to the BIO */
index 6c89f06fb105303e733474a79af0e921a745ee4c..8ebba8a8564dc85ee2436298ceec40abea904e58 100644 (file)
@@ -166,14 +166,13 @@ pqueue_pop(pqueue_s *pq)
 pitem *
 pqueue_find(pqueue_s *pq, PQ_64BIT priority)
        {
-       pitem *next, *prev = NULL;
+       pitem *next;
        pitem *found = NULL;
 
        if ( pq->items == NULL)
                return NULL;
 
-       for ( next = pq->items; next->next != NULL; 
-                 prev = next, next = next->next)
+       for ( next = pq->items; next->next != NULL; next = next->next)
                {
                if ( pq_64bit_eq(&(next->priority), &priority))
                        {
@@ -189,13 +188,6 @@ pqueue_find(pqueue_s *pq, PQ_64BIT priority)
        if ( ! found)
                return NULL;
 
-#if 0 /* find works in peek mode */
-       if ( prev == NULL)
-               pq->items = next->next;
-       else
-               prev->next = next->next;
-#endif
-
        return found;
        }
 
index 84276d7d4602ea4525492901e4d0c6de9f5da7fe..181056847e14b31c301248252a029509695ac855 100644 (file)
@@ -265,8 +265,8 @@ err:
 const char *RAND_file_name(char *buf, size_t size)
        {
        char *s=NULL;
-       int ok = 0;
 #ifdef __OpenBSD__
+       int ok = 0;
        struct stat sb;
 #endif
 
@@ -294,7 +294,9 @@ const char *RAND_file_name(char *buf, size_t size)
                        BUF_strlcat(buf,"/",size);
 #endif
                        BUF_strlcat(buf,RFILE,size);
+#ifdef __OpenBSD__
                        ok = 1;
+#endif
                        }
                else
                        buf[0] = '\0'; /* no file name */
index b85456e65bc6aeb89b792c12ef5daf78f1f5452b..b2f9290d5a0c95af9f3850abf6536e234a3f8254 100644 (file)
@@ -97,7 +97,6 @@ static int x509_subject_cmp(X509 **a, X509 **b)
 int X509_verify_cert(X509_STORE_CTX *ctx)
        {
        X509 *x,*xtmp,*chain_ss=NULL;
-       X509_NAME *xn;
        int bad_chain = 0;
        X509_VERIFY_PARAM *param = ctx->param;
        int depth,i,ok=0;
@@ -149,7 +148,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
                                         */
 
                /* If we are self signed, we break */
-               xn=X509_get_issuer_name(x);
                if (ctx->check_issued(ctx, x,x)) break;
 
                /* If we were passed a cert chain, use it first */
@@ -186,7 +184,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
 
        i=sk_X509_num(ctx->chain);
        x=sk_X509_value(ctx->chain,i-1);
-       xn = X509_get_subject_name(x);
        if (ctx->check_issued(ctx, x, x))
                {
                /* we have a self signed certificate */
@@ -235,7 +232,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
                if (depth < num) break;
 
                /* If we are self signed, we break */
-               xn=X509_get_issuer_name(x);
                if (ctx->check_issued(ctx,x,x)) break;
 
                ok = ctx->get_issuer(&xtmp, ctx, x);
@@ -254,7 +250,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
                }
 
        /* we now have our chain, lets check it... */
-       xn=X509_get_issuer_name(x);
 
        /* Is last certificate looked up self signed? */
        if (!ctx->check_issued(ctx,x,x))
index ab8a25962c6eea98f64277e6f8f374d8bbc6bf3b..fca7a9cea62ecf0b002efaa627d9d7aa256e86ec 100644 (file)
@@ -1080,11 +1080,11 @@ static int hwcrhk_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 static int hwcrhk_rsa_finish(RSA *rsa)
        {
        HWCryptoHook_RSAKeyHandle *hptr;
-       int ret;
+
        hptr = RSA_get_ex_data(rsa, hndidx_rsa);
        if (hptr)
                 {
-                ret = p_hwcrhk_RSAUnloadKey(*hptr, NULL);
+                p_hwcrhk_RSAUnloadKey(*hptr, NULL);
                 OPENSSL_free(hptr);
                RSA_set_ex_data(rsa, hndidx_rsa, NULL);
                 }
index bc6517984649850c6ccb3d32f9b3af5c44a5c909..2e64ff32770dbf130d3dda10e7e465db88226045 100644 (file)
@@ -811,7 +811,6 @@ static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
        SW_PARAM sw_param;
        SW_STATUS sw_status;
        SW_LARGENUMBER arg, res;
-       unsigned char *ptr;
        BN_CTX *ctx;
        BIGNUM *dsa_p = NULL;
        BIGNUM *dsa_q = NULL;
@@ -899,7 +898,6 @@ static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
                goto err;
                }
        /* Convert the response */
-       ptr = (unsigned char *)result->d;
        if((to_return = DSA_SIG_new()) == NULL)
                goto err;
        to_return->r = BN_bin2bn((unsigned char *)result->d, 20, NULL);
index a0f320caf5bf9a296e85a0fc8899d47ecfb4db06..f1c81013b189df6292a24ac7a5d2f7d8871578d5 100644 (file)
@@ -631,10 +631,8 @@ static int ubsec_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
                        const BIGNUM *dq, const BIGNUM *qinv, BN_CTX *ctx)
        {
        int     y_len,
-               m_len,
                fd;
 
-       m_len = BN_num_bytes(p) + BN_num_bytes(q) + 1;
        y_len = BN_num_bits(p) + BN_num_bits(q);
 
        /* Check if hardware can't handle this argument. */
index 223d11627948e3a44809ee74ad5ee6ac5761ae67..0aa77ee51d509c0ab7fd5b21cd87f6775bbff741 100644 (file)
@@ -144,7 +144,7 @@ IMPLEMENT_dtls1_meth_func(DTLSv1_client_method,
 int dtls1_connect(SSL *s)
        {
        BUF_MEM *buf=NULL;
-       unsigned long Time=(unsigned long)time(NULL),l;
+       unsigned long Time=(unsigned long)time(NULL);
        void (*cb)(const SSL *ssl,int type,int val)=NULL;
        int ret= -1;
        int new_state,state,skip=0;;
@@ -374,7 +374,6 @@ int dtls1_connect(SSL *s)
                        dtls1_start_timer(s);
                        ret=dtls1_send_client_key_exchange(s);
                        if (ret <= 0) goto end;
-                       l=s->s3->tmp.new_cipher->algorithms;
                        /* EAY EAY EAY need to check for DH fix cert
                         * sent back */
                        /* For TLS, cert_req is set to 2, so a cert chain
index 3dfa5adba3f92fa2928262f4d665a19802147107..4a6c9090314d293c62c708c0aa6f748d9eb0d54f 100644 (file)
@@ -131,13 +131,11 @@ int dtls1_enc(SSL *s, int send)
        SSL3_RECORD *rec;
        EVP_CIPHER_CTX *ds;
        unsigned long l;
-       int bs,i,ii,j,k,n=0;
+       int bs,i,ii,j,k;
        const EVP_CIPHER *enc;
 
        if (send)
                {
-               if (s->write_hash != NULL)
-                       n=EVP_MD_size(s->write_hash);
                ds=s->enc_write_ctx;
                rec= &(s->s3->wrec);
                if (s->enc_write_ctx == NULL)
@@ -158,8 +156,6 @@ int dtls1_enc(SSL *s, int send)
                }
        else
                {
-               if (s->read_hash != NULL)
-                       n=EVP_MD_size(s->read_hash);
                ds=s->enc_read_ctx;
                rec= &(s->s3->rrec);
                if (s->enc_read_ctx == NULL)
index 9fe21c3ea1445af08a03e52d6bbffb31f5936a5f..3f19077af111ee5c25a8e018d45e44f6e980851f 100644 (file)
@@ -256,9 +256,6 @@ dtls1_process_buffered_records(SSL *s)
     item = pqueue_peek(s->d1->unprocessed_rcds.q);
     if (item)
         {
-        DTLS1_RECORD_DATA *rdata;
-        rdata = (DTLS1_RECORD_DATA *)item->data;
-        
         /* Check if epoch is current. */
         if (s->d1->unprocessed_rcds.epoch != s->d1->r_epoch)
             return(1);  /* Nothing to do. */
@@ -331,7 +328,7 @@ dtls1_get_buffered_record(SSL *s)
 static int
 dtls1_process_record(SSL *s)
 {
-    int i,al;
+    int al;
        int clear=0;
     int enc_err;
        SSL_SESSION *sess;
@@ -418,7 +415,7 @@ if (        (sess == NULL) ||
 #endif
                        }
                rr->length-=mac_size;
-               i=s->method->ssl3_enc->mac(s,md,0);
+               s->method->ssl3_enc->mac(s,md,0);
                if (memcmp(md,&(rr->data[rr->length]),mac_size) != 0)
                        {
                        goto err;
@@ -484,14 +481,12 @@ int dtls1_get_record(SSL *s)
        int ssl_major,ssl_minor;
        int i,n;
        SSL3_RECORD *rr;
-       SSL_SESSION *sess;
        unsigned char *p = NULL;
        unsigned short version;
        DTLS1_BITMAP *bitmap;
        unsigned int is_next_epoch;
 
        rr= &(s->s3->rrec);
-       sess=s->session;
 
     /* The epoch may have changed.  If so, process all the
      * pending records.  This is a non-blocking operation. */
index fc2981308d55e3d4b16e5f6fb59482ea5226cd4b..0b82777b2ae675657e114d771b95e473c15585a1 100644 (file)
@@ -97,14 +97,8 @@ SSL_CIPHER *ssl23_get_cipher(unsigned int u)
  * available */
 SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p)
        {
-       SSL_CIPHER c,*cp;
-       unsigned long id;
-       int n;
+       SSL_CIPHER *cp;
 
-       n=ssl3_num_ciphers();
-       id=0x03000000|((unsigned long)p[0]<<16L)|
-               ((unsigned long)p[1]<<8L)|(unsigned long)p[2];
-       c.id=id;
        cp=ssl3_get_cipher_by_char(p);
 #ifndef OPENSSL_NO_SSL2
        if (cp == NULL)
index 01d62fad1165341f3a287e1d44f7d0bd2145fe1e..eeffe2549248b071e04aef0054bb49b320627bfc 100644 (file)
@@ -697,7 +697,6 @@ static int server_hello(SSL *s)
        {
        unsigned char *p,*d;
        int n,hit;
-       STACK_OF(SSL_CIPHER) *sk;
 
        p=(unsigned char *)s->init_buf->data;
        if (s->state == SSL2_ST_SEND_SERVER_HELLO_A)
@@ -778,7 +777,6 @@ static int server_hello(SSL *s)
                        
                        /* lets send out the ciphers we like in the
                         * prefered order */
-                       sk= s->session->ciphers;
                        n=ssl_cipher_list_to_bytes(s,s->session->ciphers,d,0);
                        d+=n;
                        s2n(n,p);               /* add cipher length */
index e5138b6e5eee0d8b405d129ca25452745b2fe0d8..b0d49d8cd37567cb88feb1ee5642286e21941a77 100644 (file)
@@ -166,7 +166,7 @@ IMPLEMENT_ssl3_meth_func(SSLv3_client_method,
 int ssl3_connect(SSL *s)
        {
        BUF_MEM *buf=NULL;
-       unsigned long Time=(unsigned long)time(NULL),l;
+       unsigned long Time=(unsigned long)time(NULL);
        void (*cb)(const SSL *ssl,int type,int val)=NULL;
        int ret= -1;
        int new_state,state,skip=0;
@@ -360,7 +360,6 @@ int ssl3_connect(SSL *s)
                case SSL3_ST_CW_KEY_EXCH_B:
                        ret=ssl3_send_client_key_exchange(s);
                        if (ret <= 0) goto end;
-                       l=s->s3->tmp.new_cipher->algorithms;
                        /* EAY EAY EAY need to check for DH fix cert
                         * sent back */
                        /* For TLS, cert_req is set to 2, so a cert chain
index 06e54666b2774a6109f19fbdae5e2c585fc91ab6..1539a4ce1c5479a100e0fc718ba25e549947ec85 100644 (file)
@@ -191,7 +191,7 @@ static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
 
 int ssl3_change_cipher_state(SSL *s, int which)
        {
-       unsigned char *p,*key_block,*mac_secret;
+       unsigned char *p,*mac_secret;
        unsigned char exp_key[EVP_MAX_KEY_LENGTH];
        unsigned char exp_iv[EVP_MAX_IV_LENGTH];
        unsigned char *ms,*key,*iv,*er1,*er2;
@@ -214,7 +214,6 @@ int ssl3_change_cipher_state(SSL *s, int which)
        else
                comp=s->s3->tmp.new_compression->method;
 #endif
-       key_block=s->s3->tmp.key_block;
 
        if (which & SSL3_CC_READ)
                {
index d82e47a14eb6e41b7b57314bbe02b15fd204b3b0..df8ec82ebf3a6d15e77c12c83d9f56c05c3e12ea 100644 (file)
@@ -297,7 +297,7 @@ int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
 SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
             long length)
        {
-       int version,ssl_version=0,i;
+       int ssl_version=0,i;
        long id;
        ASN1_INTEGER ai,*aip;
        ASN1_OCTET_STRING os,*osp;
@@ -311,7 +311,6 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
 
        ai.data=NULL; ai.length=0;
        M_ASN1_D2I_get_x(ASN1_INTEGER,aip,d2i_ASN1_INTEGER);
-       version=(int)ASN1_INTEGER_get(aip);
        if (ai.data != NULL) { OPENSSL_free(ai.data); ai.data=NULL; ai.length=0; }
 
        /* we don't care about the version right now :-) */
index 5e2d436da39a333069996c0a2c25b65c3fe29366..a34680ee8502503c1afb29168c005b65e7a0a877 100644 (file)
@@ -777,7 +777,7 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
                CIPHER_ORDER **tail_p, SSL_CIPHER **ca_list)
        {
        unsigned long algorithms, mask, algo_strength, mask_strength;
-       const char *l, *start, *buf;
+       const char *l, *buf;
        int j, multi, found, rule, retval, ok, buflen;
        unsigned long cipher_id = 0, ssl_version = 0;
        char ch;
@@ -809,7 +809,6 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
 
                algorithms = mask = algo_strength = mask_strength = 0;
 
-               start=l;
                for (;;)
                        {
                        ch = *l;
@@ -1100,7 +1099,7 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len)
        int is_export,pkl,kl;
        const char *ver,*exp_str;
        const char *kx,*au,*enc,*mac;
-       unsigned long alg,alg2,alg_s;
+       unsigned long alg,alg2;
 #ifdef KSSL_DEBUG
        static const char *format="%-23s %s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s%s AL=%lx\n";
 #else
@@ -1108,7 +1107,6 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len)
 #endif /* KSSL_DEBUG */
 
        alg=cipher->algorithms;
-       alg_s=cipher->algo_strength;
        alg2=cipher->algorithm2;
 
        is_export=SSL_C_IS_EXPORT(cipher);
index 15650da5e7206cfd3fb0b6d86184aa74ed24fffb..b6b8e6038aa6f49ab19ba3c8140f5aef8c7bccd9 100644 (file)
@@ -1940,15 +1940,13 @@ int check_srvr_ecc_cert_and_alg(X509 *x, SSL_CIPHER *cs)
 /* THIS NEEDS CLEANING UP */
 X509 *ssl_get_server_send_cert(SSL *s)
        {
-       unsigned long alg,mask,kalg;
+       unsigned long alg,kalg;
        CERT *c;
-       int i,is_export;
+       int i;
 
        c=s->cert;
        ssl_set_cert_masks(c, s->s3->tmp.new_cipher);
        alg=s->s3->tmp.new_cipher->algorithms;
-       is_export=SSL_C_IS_EXPORT(s->s3->tmp.new_cipher);
-       mask=is_export?c->export_mask:c->mask;
        kalg=alg&(SSL_MKEY_MASK|SSL_AUTH_MASK);
 
        if (kalg & SSL_kECDH)
index b09c542087ba9afe42cdc9ff5c0c09aa25731544..310e0677e90a37d5d497cea68054ce5ff9f8d5c7 100644 (file)
@@ -1351,7 +1351,6 @@ int doit(SSL *s_ssl, SSL *c_ssl, long count)
        BIO *c_bio=NULL;
        BIO *s_bio=NULL;
        int c_r,c_w,s_r,s_w;
-       int c_want,s_want;
        int i,j;
        int done=0;
        int c_write,s_write;
@@ -1386,8 +1385,6 @@ int doit(SSL *s_ssl, SSL *c_ssl, long count)
 
        c_r=0; s_r=1;
        c_w=1; s_w=0;
-       c_want=W_WRITE;
-       s_want=0;
        c_write=1,s_write=0;
 
        /* We can always do writes */
index dab6e4485b782447dc644c00e4538c74b5a3ce99..34830988fca89747047356abec0aee79539faa6d 100644 (file)
@@ -125,7 +125,7 @@ static void tls1_P_hash(const EVP_MD *md, const unsigned char *sec,
                        int sec_len, unsigned char *seed, int seed_len,
                        unsigned char *out, int olen)
        {
-       int chunk,n;
+       int chunk;
        unsigned int j;
        HMAC_CTX ctx;
        HMAC_CTX ctx_tmp;
@@ -143,7 +143,6 @@ static void tls1_P_hash(const EVP_MD *md, const unsigned char *sec,
        HMAC_Update(&ctx,seed,seed_len);
        HMAC_Final(&ctx,A1,&A1_len);
 
-       n=0;
        for (;;)
                {
                HMAC_Init_ex(&ctx,NULL,0,NULL,NULL); /* re-init */
@@ -227,14 +226,14 @@ static void tls1_generate_key_block(SSL *s, unsigned char *km,
 int tls1_change_cipher_state(SSL *s, int which)
        {
        static const unsigned char empty[]="";
-       unsigned char *p,*key_block,*mac_secret;
+       unsigned char *p,*mac_secret;
        unsigned char *exp_label,buf[TLS_MD_MAX_CONST_SIZE+
                SSL3_RANDOM_SIZE*2];
        unsigned char tmp1[EVP_MAX_KEY_LENGTH];
        unsigned char tmp2[EVP_MAX_KEY_LENGTH];
        unsigned char iv1[EVP_MAX_IV_LENGTH*2];
        unsigned char iv2[EVP_MAX_IV_LENGTH*2];
-       unsigned char *ms,*key,*iv,*er1,*er2;
+       unsigned char *ms,*key,*iv;
        int client_write;
        EVP_CIPHER_CTX *dd;
        const EVP_CIPHER *c;
@@ -251,9 +250,10 @@ int tls1_change_cipher_state(SSL *s, int which)
 #ifndef OPENSSL_NO_COMP
        comp=s->s3->tmp.new_compression;
 #endif
-       key_block=s->s3->tmp.key_block;
 
 #ifdef KSSL_DEBUG
+       key_block=s->s3->tmp.key_block;
+
        printf("tls1_change_cipher_state(which= %d) w/\n", which);
        printf("\talg= %ld, comp= %p\n", s->s3->tmp.new_cipher->algorithms,
                 (void *)comp);
@@ -348,8 +348,6 @@ int tls1_change_cipher_state(SSL *s, int which)
                       cl : SSL_C_EXPORT_KEYLENGTH(s->s3->tmp.new_cipher)) : cl;
        /* Was j=(exp)?5:EVP_CIPHER_key_length(c); */
        k=EVP_CIPHER_iv_length(c);
-       er1= &(s->s3->client_random[0]);
-       er2= &(s->s3->server_random[0]);
        if (    (which == SSL3_CHANGE_CIPHER_CLIENT_WRITE) ||
                (which == SSL3_CHANGE_CIPHER_SERVER_READ))
                {
@@ -535,13 +533,11 @@ int tls1_enc(SSL *s, int send)
        SSL3_RECORD *rec;
        EVP_CIPHER_CTX *ds;
        unsigned long l;
-       int bs,i,ii,j,k,n=0;
+       int bs,i,ii,j,k;
        const EVP_CIPHER *enc;
 
        if (send)
                {
-               if (s->write_hash != NULL)
-                       n=EVP_MD_size(s->write_hash);
                ds=s->enc_write_ctx;
                rec= &(s->s3->wrec);
                if (s->enc_write_ctx == NULL)
@@ -551,8 +547,6 @@ int tls1_enc(SSL *s, int send)
                }
        else
                {
-               if (s->read_hash != NULL)
-                       n=EVP_MD_size(s->read_hash);
                ds=s->enc_read_ctx;
                rec= &(s->s3->rrec);
                if (s->enc_read_ctx == NULL)
index 8b5311277015b747f000f76de6a757209be9e418..d61c08c8ef424698e50dde5e8d8d09f7a759ccf5 100644 (file)
@@ -601,9 +601,9 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
 
 int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, int n, int *al)
        {
+       unsigned short length;
        unsigned short type;
        unsigned short size;
-       unsigned short len;  
        unsigned char *data = *p;
        int tlsext_servername = 0;
        int renegotiate_seen = 0;
@@ -611,7 +611,12 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
        if (data >= (d+n-2))
                goto ri_check;
 
-       n2s(data,len);
+       n2s(data,length);
+       if (data+length != d+n)
+               {
+               *al = SSL_AD_DECODE_ERROR;
+               return 0;
+               }
 
        while(data <= (d+n-4))
                {