Update tunala so it builds ok with OPENSSL_NO_DEPRECATED, and improve the
authorGeoff Thorpe <geoff@openssl.org>
Fri, 28 Mar 2008 01:56:08 +0000 (01:56 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Fri, 28 Mar 2008 01:56:08 +0000 (01:56 +0000)
autoungunk.sh logic (autobits have grown since I last tried this...).

demos/tunala/autoungunk.sh
demos/tunala/cb.c
demos/tunala/tunala.c

index 0c9123b6cfbc3ac69798580bc25a2c5a396766c8..21790880d71d828e92244c517b4a0167d5165d07 100755 (executable)
@@ -15,4 +15,5 @@ fi
 
 rm -f aclocal.m4 config.* configure install-sh \
        missing mkinstalldirs stamp-h.* Makefile.in \
-       ltconfig ltmain.sh
+       ltconfig ltmain.sh depcomp
+rm -rf autom4te.cache
index e64983896ebb443a937ba6a635783c622cc1bc61..f6e452ae93579767944e8aba728c1a0efe0c4362 100644 (file)
@@ -134,8 +134,27 @@ RSA *cb_generate_tmp_rsa(SSL *s, int is_export, int keylength)
        /* TODO: Perhaps make it so our global key can be generated on-the-fly
         * after certain intervals? */
        static RSA *rsa_tmp = NULL;
-       if(!rsa_tmp)
-               rsa_tmp = RSA_generate_key(keylength, RSA_F4, NULL, NULL);
+       BIGNUM *bn = NULL;
+       int ok = 1;
+       if(!rsa_tmp) {
+               ok = 0;
+               if(!(bn = BN_new()))
+                       goto end;
+               if(!BN_set_word(bn, RSA_F4))
+                       goto end;
+               if(!(rsa_tmp = RSA_new()))
+                       goto end;
+               if(!RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL))
+                       goto end;
+               ok = 1;
+       }
+end:
+       if(bn)
+               BN_free(bn);
+       if(!ok) {
+               RSA_free(rsa_tmp);
+               rsa_tmp = NULL;
+       }
        return rsa_tmp;
 }
 
index e918cba2ce8aa4c1f89a53beab8ed953bb702d53..ec49d3e943e3c2e276d624cdbd6b8ac97b41ce22 100644 (file)
@@ -697,9 +697,11 @@ static int ctx_set_dh(SSL_CTX *ctx, const char *dh_file, const char *dh_special)
                        abort();
                fprintf(stderr, "Info, generating DH parameters ... ");
                fflush(stderr);
-               if((dh = DH_generate_parameters(512, DH_GENERATOR_5,
-                                       NULL, NULL)) == NULL) {
+               if(!(dh = DH_new()) || !DH_generate_parameters_ex(dh, 512,
+                                       DH_GENERATOR_5, NULL)) {
                        fprintf(stderr, "error!\n");
+                       if(dh)
+                               DH_free(dh);
                        return 0;
                }
                fprintf(stderr, "complete\n");
@@ -733,7 +735,7 @@ static SSL_CTX *initialise_ssl_ctx(int server_mode, const char *engine_id,
                unsigned int verify_depth)
 {
        SSL_CTX *ctx = NULL, *ret = NULL;
-       SSL_METHOD *meth;
+       const SSL_METHOD *meth;
        ENGINE *e = NULL;
 
         OpenSSL_add_ssl_algorithms();