Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3CA628E57 for ; Tue, 13 Sep 2011 05:12:54 +0000 (UTC) Received: (qmail 59704 invoked by uid 500); 13 Sep 2011 05:12:52 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 59344 invoked by uid 500); 13 Sep 2011 05:12:36 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 59325 invoked by uid 99); 13 Sep 2011 05:12:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2011 05:12:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2011 05:12:30 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5B2002388A56 for ; Tue, 13 Sep 2011 05:12:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1170041 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr/ssl.h modules/openssl/api.c modules/openssl/password.c modules/openssl/util.c Date: Tue, 13 Sep 2011 05:12:10 -0000 To: commits@commons.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110913051210.5B2002388A56@eris.apache.org> Author: mturk Date: Tue Sep 13 05:12:09 2011 New Revision: 1170041 URL: http://svn.apache.org/viewvc?rev=1170041&view=rev Log: Make all private function having the same naming convention Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c commons/sandbox/runtime/trunk/src/main/native/modules/openssl/util.c Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h?rev=1170041&r1=1170040&r2=1170041&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h Tue Sep 13 05:12:09 2011 @@ -297,8 +297,8 @@ typedef struct acr_ssl_ctxt_t { long stapling_resptime_skew; long stapling_resp_maxage; int stapling_cache_timeout; - bool stapling_return_errors; - bool stapling_fake_trylater; + int stapling_return_errors; + int stapling_fake_trylater; int stapling_errcache_timeout; acr_time_t stapling_responder_timeout; const char *stapling_force_url; @@ -355,22 +355,25 @@ struct ssl_sd_t { }; /** - * Additional Functions + * Additional Functions + * Wa are using all lowercase naming convention with ssl prefix. + * TODO: See which functions can be made static by moving them to + * the module where they are used. */ void ssl_init_app_data2_idx(void); void *ssl_get_app_data2(SSL *); void ssl_set_app_data2(SSL *, void *); int ssl_password_callback(char *, int, int, void *); -void ssl_BIO_close(BIO *); -void ssl_BIO_doref(BIO *); +void ssl_bio_close(BIO *); +void ssl_bio_doref(BIO *); DH *ssl_dh_get_tmp_param(int); DH *ssl_dh_get_param_from_file(const char *); -RSA *ssl_callback_tmp_RSA(SSL *, int, int); -DH *ssl_callback_tmp_DH(SSL *, int, int); +RSA *ssl_callback_tmp_rsa(SSL *, int, int); +DH *ssl_callback_tmp_dh(SSL *, int, int); void ssl_callback_handshake(const SSL *, int, int); void ssl_vhost_algo_id(const unsigned char *, unsigned char *, int); int ssl_ctx_use_certificate_chain(SSL_CTX *, const char *, int); -int ssl_callback_SSL_verify(int, X509_STORE_CTX *); +int ssl_callback_ssl_verify(int, X509_STORE_CTX *); int ssl_rand_seed(const char *file); #endif Modified: commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c?rev=1170041&r1=1170040&r2=1170041&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c Tue Sep 13 05:12:09 2011 @@ -90,6 +90,9 @@ struct SSLAPIst { BIO* (*fpBIO_new_file)(const char *, const char *); BIO* (*fpBIO_new_fp)(FILE *, int); BIO_METHOD* (*fpBIO_s_file)(void); + BIO_METHOD* (*fpBIO_s_mem)(void); + int (*fpBIO_printf)(BIO *, const char *, ...); + int (*fpBIO_vprintf)(BIO *, const char *, va_list); /*** BIGNUM ***/ BIGNUM* (*fpBN_bin2bn)(const unsigned char *, int, BIGNUM *); @@ -272,6 +275,9 @@ ACR_JNI_EXPORT(jboolean, Native, ldopens CRYPTO_FPLOAD(BIO_new_file); CRYPTO_FPLOAD(BIO_new_fp); CRYPTO_FPLOAD(BIO_s_file); + CRYPTO_FPLOAD(BIO_s_mem); + CRYPTO_FPLOAD(BIO_printf); + CRYPTO_FPLOAD(BIO_vprintf); /*** BIGNUM ***/ CRYPTO_FPLOAD(BN_bin2bn); @@ -405,6 +411,27 @@ BIO_METHOD *BIO_s_file(void) return SSLAPI_CALL(BIO_s_file)(); } +BIO_METHOD *BIO_s_mem(void) +{ + return SSLAPI_CALL(BIO_s_mem)(); +} + +int BIO_vprintf(BIO *bio, const char *format, va_list args) +{ + return SSLAPI_CALL(BIO_vprintf)(bio, format, args); +} + +int BIO_printf(BIO *bio, const char *format, ...) +{ + int rv; + va_list ap; + + va_start(ap, format); + rv = BIO_vprintf(bio, format, ap); + va_end(ap); + return rv; +} + BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret) { return SSLAPI_CALL(BN_bin2bn)(s, len, ret); Modified: commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c?rev=1170041&r1=1170040&r2=1170041&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c Tue Sep 13 05:12:09 2011 @@ -33,7 +33,7 @@ int ssl_password_callback(char *buf, int { ssl_pass_cb_t *pcb = (ssl_pass_cb_t *)cb; - if (buf == 0) + if (buf == 0 || bufsiz < 0) return 0; buf[0] = '\0'; if (pcb == 0) Modified: commons/sandbox/runtime/trunk/src/main/native/modules/openssl/util.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/openssl/util.c?rev=1170041&r1=1170040&r2=1170041&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/modules/openssl/util.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/modules/openssl/util.c Tue Sep 13 05:12:09 2011 @@ -257,7 +257,7 @@ DH *ssl_dh_get_param_from_file(const cha * which we now just hand out on demand.... */ -RSA *ssl_callback_tmp_RSA(SSL *ssl, int export, int keylen) +RSA *ssl_callback_tmp_rsa(SSL *ssl, int export, int keylen) { int idx; @@ -292,7 +292,7 @@ RSA *ssl_callback_tmp_RSA(SSL *ssl, int /* * Hand out the already generated DH parameters... */ -DH *ssl_callback_tmp_DH(SSL *ssl, int export, int keylen) +DH *ssl_callback_tmp_dh(SSL *ssl, int export, int keylen) { int idx; switch (keylen) {