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) {