diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libssl/ssl/ssltest.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/regress/lib/libssl/ssl/ssltest.c b/src/regress/lib/libssl/ssl/ssltest.c index 0c9a03c84b..837622816a 100644 --- a/src/regress/lib/libssl/ssl/ssltest.c +++ b/src/regress/lib/libssl/ssl/ssltest.c | |||
| @@ -181,8 +181,6 @@ | |||
| 181 | #define TEST_CLIENT_CERT "../apps/client.pem" | 181 | #define TEST_CLIENT_CERT "../apps/client.pem" |
| 182 | 182 | ||
| 183 | static int verify_callback(int ok, X509_STORE_CTX *ctx); | 183 | static int verify_callback(int ok, X509_STORE_CTX *ctx); |
| 184 | static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength); | ||
| 185 | static void free_tmp_rsa(void); | ||
| 186 | static int app_verify_callback(X509_STORE_CTX *ctx, void *arg); | 184 | static int app_verify_callback(X509_STORE_CTX *ctx, void *arg); |
| 187 | #define APP_CALLBACK_STRING "Test Callback Argument" | 185 | #define APP_CALLBACK_STRING "Test Callback Argument" |
| 188 | struct app_verify_arg { | 186 | struct app_verify_arg { |
| @@ -658,8 +656,6 @@ bad: | |||
| 658 | EC_KEY_free(ecdh); | 656 | EC_KEY_free(ecdh); |
| 659 | } | 657 | } |
| 660 | 658 | ||
| 661 | SSL_CTX_set_tmp_rsa_callback(s_ctx, tmp_rsa_cb); | ||
| 662 | |||
| 663 | if (!SSL_CTX_use_certificate_file(s_ctx, server_cert, | 659 | if (!SSL_CTX_use_certificate_file(s_ctx, server_cert, |
| 664 | SSL_FILETYPE_PEM)) { | 660 | SSL_FILETYPE_PEM)) { |
| 665 | ERR_print_errors(bio_err); | 661 | ERR_print_errors(bio_err); |
| @@ -772,7 +768,6 @@ end: | |||
| 772 | SSL_CTX_free(c_ctx); | 768 | SSL_CTX_free(c_ctx); |
| 773 | BIO_free(bio_stdout); | 769 | BIO_free(bio_stdout); |
| 774 | 770 | ||
| 775 | free_tmp_rsa(); | ||
| 776 | #ifndef OPENSSL_NO_ENGINE | 771 | #ifndef OPENSSL_NO_ENGINE |
| 777 | ENGINE_cleanup(); | 772 | ENGINE_cleanup(); |
| 778 | #endif | 773 | #endif |
| @@ -1844,44 +1839,6 @@ app_verify_callback(X509_STORE_CTX *ctx, void *arg) | |||
| 1844 | return (ok); | 1839 | return (ok); |
| 1845 | } | 1840 | } |
| 1846 | 1841 | ||
| 1847 | static RSA *rsa_tmp = NULL; | ||
| 1848 | |||
| 1849 | static RSA * | ||
| 1850 | tmp_rsa_cb(SSL *s, int is_export, int keylength) | ||
| 1851 | { | ||
| 1852 | BIGNUM *bn = NULL; | ||
| 1853 | if (rsa_tmp == NULL) { | ||
| 1854 | bn = BN_new(); | ||
| 1855 | rsa_tmp = RSA_new(); | ||
| 1856 | if (!bn || !rsa_tmp || !BN_set_word(bn, RSA_F4)) { | ||
| 1857 | BIO_printf(bio_err, "Memory error..."); | ||
| 1858 | goto end; | ||
| 1859 | } | ||
| 1860 | BIO_printf(bio_err, "Generating temp (%d bit) RSA key...", keylength); | ||
| 1861 | (void)BIO_flush(bio_err); | ||
| 1862 | if (!RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) { | ||
| 1863 | BIO_printf(bio_err, "Error generating key."); | ||
| 1864 | RSA_free(rsa_tmp); | ||
| 1865 | rsa_tmp = NULL; | ||
| 1866 | } | ||
| 1867 | end: | ||
| 1868 | BIO_printf(bio_err, "\n"); | ||
| 1869 | (void)BIO_flush(bio_err); | ||
| 1870 | } | ||
| 1871 | if (bn) | ||
| 1872 | BN_free(bn); | ||
| 1873 | return (rsa_tmp); | ||
| 1874 | } | ||
| 1875 | |||
| 1876 | static void | ||
| 1877 | free_tmp_rsa(void) | ||
| 1878 | { | ||
| 1879 | if (rsa_tmp != NULL) { | ||
| 1880 | RSA_free(rsa_tmp); | ||
| 1881 | rsa_tmp = NULL; | ||
| 1882 | } | ||
| 1883 | } | ||
| 1884 | |||
| 1885 | /* These DH parameters have been generated as follows: | 1842 | /* These DH parameters have been generated as follows: |
| 1886 | * $ openssl dhparam -C -noout 1024 | 1843 | * $ openssl dhparam -C -noout 1024 |
| 1887 | * $ openssl dhparam -C -noout -dsaparam 1024 | 1844 | * $ openssl dhparam -C -noout -dsaparam 1024 |
