Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 96956 | Differences between
and this patch

Collapse All | Expand All

(-)stunnel-4.10/src/ssl.c (-9 lines)
Lines 305-328 Link Here
305
        SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_cb);
305
        SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_cb);
306
#endif
306
#endif
307
        for(i=0; i<3; i++) {
307
        for(i=0; i<3; i++) {
308
#ifdef NO_RSA
309
            if(SSL_CTX_use_PrivateKey_file(ctx, options.key,
308
            if(SSL_CTX_use_PrivateKey_file(ctx, options.key,
310
                    SSL_FILETYPE_PEM))
309
                    SSL_FILETYPE_PEM))
311
#else /* NO_RSA */
312
            if(SSL_CTX_use_RSAPrivateKey_file(ctx, options.key,
313
                    SSL_FILETYPE_PEM))
314
#endif /* NO_RSA */
315
                break;
310
                break;
316
            if(i<2 && ERR_GET_REASON(ERR_peek_error())==EVP_R_BAD_DECRYPT) {
311
            if(i<2 && ERR_GET_REASON(ERR_peek_error())==EVP_R_BAD_DECRYPT) {
317
                sslerror_stack(); /* dump the error stack */
312
                sslerror_stack(); /* dump the error stack */
318
                s_log(LOG_ERR, "Wrong pass phrase: retrying");
313
                s_log(LOG_ERR, "Wrong pass phrase: retrying");
319
                continue;
314
                continue;
320
            }
315
            }
321
#ifdef NO_RSA
322
            sslerror("SSL_CTX_use_PrivateKey_file");
316
            sslerror("SSL_CTX_use_PrivateKey_file");
323
#else /* NO_RSA */
324
            sslerror("SSL_CTX_use_RSAPrivateKey_file");
325
#endif /* NO_RSA */
326
            exit(1);
317
            exit(1);
327
        }
318
        }
328
        if(!SSL_CTX_check_private_key(ctx)) {
319
        if(!SSL_CTX_check_private_key(ctx)) {

Return to bug 96956