harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r987492 - in /harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared: cipherList.h sslParameters.c
Date Fri, 20 Aug 2010 13:02:23 GMT
Author: odeakin
Date: Fri Aug 20 13:02:23 2010
New Revision: 987492

URL: http://svn.apache.org/viewvc?rev=987492&view=rev
Log:
Replace cipher list with correct spec names for those ciphers found in the OpenSSL spec pages.
Update sslParameters.c to ignore returned ciphers that don't have names that can be converted.
This might not be an exhaustive list of names, but can be expanded later.

Modified:
    harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/cipherList.h
    harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/sslParameters.c

Modified: harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/cipherList.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/cipherList.h?rev=987492&r1=987491&r2=987492&view=diff
==============================================================================
--- harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/cipherList.h
(original)
+++ harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/cipherList.h
Fri Aug 20 13:02:23 2010
@@ -15,61 +15,37 @@
  *  limitations under the License.
  */
 
-#define CIPHER_COUNT 119
+#define CIPHER_COUNT 78
+char *specNames[CIPHER_COUNT] = { "SSL_RSA_WITH_NULL_MD5", "SSL_RSA_WITH_NULL_SHA", "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
"SSL_RSA_WITH_RC4_128_MD5", 
+    "SSL_RSA_WITH_RC4_128_SHA", "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", "SSL_RSA_WITH_IDEA_CBC_SHA",
"SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 
+    "SSL_RSA_WITH_DES_CBC_SHA", "SSL_RSA_WITH_3DES_EDE_CBC_SHA", "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
"SSL_DHE_DSS_WITH_DES_CBC_SHA", 
+    "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", "SSL_DHE_RSA_WITH_DES_CBC_SHA",
"SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", 
+    "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", "SSL_DH_anon_WITH_RC4_128_MD5", "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
"SSL_DH_anon_WITH_DES_CBC_SHA", 
+    "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", "TLS_RSA_WITH_NULL_MD5", "TLS_RSA_WITH_NULL_SHA",
"TLS_RSA_EXPORT_WITH_RC4_40_MD5", "TLS_RSA_WITH_RC4_128_MD5", 
+    "TLS_RSA_WITH_RC4_128_SHA", "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", "TLS_RSA_WITH_IDEA_CBC_SHA",
"TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", 
+    "TLS_RSA_WITH_DES_CBC_SHA", "TLS_RSA_WITH_3DES_EDE_CBC_SHA", "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
"TLS_DHE_DSS_WITH_DES_CBC_SHA", 
+    "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", "TLS_DHE_RSA_WITH_DES_CBC_SHA",
"TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", 
+    "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", "TLS_DH_anon_WITH_RC4_128_MD5", "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
"TLS_DH_anon_WITH_DES_CBC_SHA", 
+    "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA",
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA", 
+    "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
"TLS_DH_anon_WITH_AES_128_CBC_SHA", 
+    "TLS_DH_anon_WITH_AES_256_CBC_SHA", "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA", "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA",
"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA", 
+    "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA", "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA", "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA",

+    "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA", "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA", "TLS_RSA_WITH_SEED_CBC_SHA",
"TLS_DHE_DSS_WITH_SEED_CBC_SHA", 
+    "TLS_DHE_RSA_WITH_SEED_CBC_SHA", "TLS_DH_anon_WITH_SEED_CBC_SHA", "TLS_GOSTR341094_WITH_28147_CNT_IMIT",
"TLS_GOSTR341001_WITH_28147_CNT_IMIT", 
+    "TLS_GOSTR341094_WITH_NULL_GOSTR3411", "TLS_GOSTR341001_WITH_NULL_GOSTR3411", "TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA",
"TLS_RSA_EXPORT1024_WITH_RC4_56_SHA", 
+    "TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", "TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA",
"TLS_DHE_DSS_WITH_RC4_128_SHA", "SSL_CK_RC4_128_WITH_MD5", 
+    "SSL_CK_RC4_128_EXPORT40_WITH_MD5", "SSL_CK_RC2_128_CBC_WITH_MD5", "SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5",
"SSL_CK_IDEA_128_CBC_WITH_MD5", 
+    "SSL_CK_DES_64_CBC_WITH_MD5", "SSL_CK_DES_192_EDE3_CBC_WITH_MD5" };
 
-char *specNames[CIPHER_COUNT] = { "SSL2_DES_64_CFB64_WITH_MD5_1", "SSL2_NULL_WITH_MD5", "SSL2_RC4_128_WITH_MD5",
"SSL2_RC4_128_EXPORT40_WITH_MD5", 
-    "SSL2_RC2_128_CBC_WITH_MD5", "SSL2_RC2_128_CBC_EXPORT40_WITH_MD5", "SSL2_IDEA_128_CBC_WITH_MD5",
"SSL2_DES_64_CBC_WITH_MD5", 
-    "SSL2_DES_64_CBC_WITH_SHA", "SSL2_DES_192_EDE3_CBC_WITH_MD5", "SSL2_DES_192_EDE3_CBC_WITH_SHA",
"SSL2_RC4_64_WITH_MD5", 
-    "SSL3_RSA_NULL_MD5", "SSL3_RSA_NULL_SHA", "SSL3_RSA_RC4_40_MD5", "SSL3_RSA_RC4_128_MD5",
"SSL3_RSA_RC4_128_SHA", 
-    "SSL3_RSA_RC2_40_MD5", "SSL3_RSA_IDEA_128_SHA", "SSL3_RSA_DES_40_CBC_SHA", "SSL3_RSA_DES_64_CBC_SHA",

-    "SSL3_RSA_DES_192_CBC3_SHA", "SSL3_DH_DSS_DES_40_CBC_SHA", "SSL3_DH_DSS_DES_64_CBC_SHA",
"SSL3_DH_DSS_DES_192_CBC3_SHA", 
-    "SSL3_DH_RSA_DES_40_CBC_SHA", "SSL3_DH_RSA_DES_64_CBC_SHA", "SSL3_DH_RSA_DES_192_CBC3_SHA",
"SSL3_EDH_DSS_DES_40_CBC_SHA", 
-    "SSL3_EDH_DSS_DES_64_CBC_SHA", "SSL3_EDH_DSS_DES_192_CBC3_SHA", "SSL3_EDH_RSA_DES_40_CBC_SHA",
"SSL3_EDH_RSA_DES_64_CBC_SHA", 
-    "SSL3_EDH_RSA_DES_192_CBC3_SHA", "SSL3_ADH_RC4_40_MD5", "SSL3_ADH_RC4_128_MD5", "SSL3_ADH_DES_40_CBC_SHA",

-    "SSL3_ADH_DES_64_CBC_SHA", "SSL3_ADH_DES_192_CBC_SHA", "SSL3_KRB5_DES_64_CBC_SHA", "SSL3_KRB5_DES_192_CBC3_SHA",

-    "SSL3_KRB5_RC4_128_SHA", "SSL3_KRB5_IDEA_128_CBC_SHA", "SSL3_KRB5_DES_64_CBC_MD5", "SSL3_KRB5_DES_192_CBC3_MD5",

-    "SSL3_KRB5_RC4_128_MD5", "SSL3_KRB5_IDEA_128_CBC_MD5", "SSL3_KRB5_DES_40_CBC_SHA", "SSL3_KRB5_RC2_40_CBC_SHA",

-    "SSL3_KRB5_RC4_40_SHA", "SSL3_KRB5_DES_40_CBC_MD5", "SSL3_KRB5_RC2_40_CBC_MD5", "SSL3_KRB5_RC4_40_MD5",

-    "TLS1_RSA_EXPORT1024_WITH_RC4_56_MD5", "TLS1_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5", "TLS1_RSA_EXPORT1024_WITH_DES_CBC_SHA",

-    "TLS1_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", "TLS1_RSA_EXPORT1024_WITH_RC4_56_SHA", "TLS1_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA",

-    "TLS1_DHE_DSS_WITH_RC4_128_SHA", "TLS1_RSA_WITH_AES_128_SHA", "TLS1_DH_DSS_WITH_AES_128_SHA",
"TLS1_DH_RSA_WITH_AES_128_SHA", 
-    "TLS1_DHE_DSS_WITH_AES_128_SHA", "TLS1_DHE_RSA_WITH_AES_128_SHA", "TLS1_ADH_WITH_AES_128_SHA",
"TLS1_RSA_WITH_AES_256_SHA", 
-    "TLS1_DH_DSS_WITH_AES_256_SHA", "TLS1_DH_RSA_WITH_AES_256_SHA", "TLS1_DHE_DSS_WITH_AES_256_SHA",

-    "TLS1_DHE_RSA_WITH_AES_256_SHA", "TLS1_ADH_WITH_AES_256_SHA", "TLS1_ECDH_ECDSA_WITH_NULL_SHA",
"TLS1_ECDH_ECDSA_WITH_RC4_128_SHA", 
-    "TLS1_ECDH_ECDSA_WITH_DES_192_CBC3_SHA", "TLS1_ECDH_ECDSA_WITH_AES_128_CBC_SHA", "TLS1_ECDH_ECDSA_WITH_AES_256_CBC_SHA",

-    "TLS1_ECDHE_ECDSA_WITH_NULL_SHA", "TLS1_ECDHE_ECDSA_WITH_RC4_128_SHA", "TLS1_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA",

-    "TLS1_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", "TLS1_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", "TLS1_ECDH_RSA_WITH_NULL_SHA",

-    "TLS1_ECDH_RSA_WITH_RC4_128_SHA", "TLS1_ECDH_RSA_WITH_DES_192_CBC3_SHA", "TLS1_ECDH_RSA_WITH_AES_128_CBC_SHA",

-    "TLS1_ECDH_RSA_WITH_AES_256_CBC_SHA", "TLS1_ECDHE_RSA_WITH_NULL_SHA", "TLS1_ECDHE_RSA_WITH_RC4_128_SHA",

-    "TLS1_ECDHE_RSA_WITH_DES_192_CBC3_SHA", "TLS1_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS1_ECDHE_RSA_WITH_AES_256_CBC_SHA",

-    "TLS1_ECDH_anon_WITH_NULL_SHA", "TLS1_ECDH_anon_WITH_RC4_128_SHA", "TLS1_ECDH_anon_WITH_DES_192_CBC3_SHA",

-    "TLS1_ECDH_anon_WITH_AES_128_CBC_SHA", "TLS1_ECDH_anon_WITH_AES_256_CBC_SHA", "TLS1_PSK_WITH_RC4_128_SHA",

-    "TLS1_PSK_WITH_3DES_EDE_CBC_SHA", "TLS1_PSK_WITH_AES_128_CBC_SHA", "TLS1_PSK_WITH_AES_256_CBC_SHA",

-    "TLS1_RSA_WITH_CAMELLIA_128_CBC_SHA", "TLS1_DH_DSS_WITH_CAMELLIA_128_CBC_SHA", "TLS1_DH_RSA_WITH_CAMELLIA_128_CBC_SHA",

-    "TLS1_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA", "TLS1_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA", "TLS1_ADH_WITH_CAMELLIA_128_CBC_SHA",

-    "TLS1_RSA_WITH_CAMELLIA_256_CBC_SHA", "TLS1_DH_DSS_WITH_CAMELLIA_256_CBC_SHA", "TLS1_DH_RSA_WITH_CAMELLIA_256_CBC_SHA",

-    "TLS1_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA", "TLS1_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA", "TLS1_ADH_WITH_CAMELLIA_256_CBC_SHA",

-    "TLS1_RSA_WITH_SEED_SHA", "TLS1_DH_DSS_WITH_SEED_SHA", "TLS1_DH_RSA_WITH_SEED_SHA", "TLS1_DHE_DSS_WITH_SEED_SHA",

-    "TLS1_DHE_RSA_WITH_SEED_SHA", "TLS1_ADH_WITH_SEED_SHA"
-};
-
-char *openSSLNames[CIPHER_COUNT] = { "DES-CFB-M1", "NULL-MD5", "RC4-MD5", "EXP-RC4-MD5",
"RC2-CBC-MD5", "EXP-RC2-CBC-MD5", "IDEA-CBC-MD5", "DES-CBC-MD5", 
-    "DES-CBC-SHA", "DES-CBC3-MD5", "DES-CBC3-SHA", "RC4-64-MD5", "NULL-MD5", "NULL-SHA",
"EXP-RC4-MD5", "RC4-MD5", "RC4-SHA", "EXP-RC2-CBC-MD5", 
-    "IDEA-CBC-SHA", "EXP-DES-CBC-SHA", "DES-CBC-SHA", "DES-CBC3-SHA", "EXP-DH-DSS-DES-CBC-SHA",
"DH-DSS-DES-CBC-SHA", "DH-DSS-DES-CBC3-SHA", 
-    "EXP-DH-RSA-DES-CBC-SHA", "DH-RSA-DES-CBC-SHA", "DH-RSA-DES-CBC3-SHA", "EXP-EDH-DSS-DES-CBC-SHA",
"EDH-DSS-DES-CBC-SHA", "EDH-DSS-DES-CBC3-SHA", 
-    "EXP-EDH-RSA-DES-CBC-SHA", "EDH-RSA-DES-CBC-SHA", "EDH-RSA-DES-CBC3-SHA", "EXP-ADH-RC4-MD5",
"ADH-RC4-MD5", "EXP-ADH-DES-CBC-SHA", 
-    "ADH-DES-CBC-SHA", "ADH-DES-CBC3-SHA", "KRB5-DES-CBC-SHA", "KRB5-DES-CBC3-SHA", "KRB5-RC4-SHA",
"KRB5-IDEA-CBC-SHA", "KRB5-DES-CBC-MD5", 
-    "KRB5-DES-CBC3-MD5", "KRB5-RC4-MD5", "KRB5-IDEA-CBC-MD5", "EXP-KRB5-DES-CBC-SHA", "EXP-KRB5-RC2-CBC-SHA",
"EXP-KRB5-RC4-SHA", "EXP-KRB5-DES-CBC-MD5", 
-    "EXP-KRB5-RC2-CBC-MD5", "EXP-KRB5-RC4-MD5", "EXP1024-RC4-MD5", "EXP1024-RC2-CBC-MD5",
"EXP1024-DES-CBC-SHA", "EXP1024-DHE-DSS-DES-CBC-SHA", 
-    "EXP1024-RC4-SHA", "EXP1024-DHE-DSS-RC4-SHA", "DHE-DSS-RC4-SHA", "AES128-SHA", "DH-DSS-AES128-SHA",
"DH-RSA-AES128-SHA", "DHE-DSS-AES128-SHA", 
-    "DHE-RSA-AES128-SHA", "ADH-AES128-SHA", "AES256-SHA", "DH-DSS-AES256-SHA", "DH-RSA-AES256-SHA",
"DHE-DSS-AES256-SHA", "DHE-RSA-AES256-SHA", 
-    "ADH-AES256-SHA", "ECDH-ECDSA-NULL-SHA", "ECDH-ECDSA-RC4-SHA", "ECDH-ECDSA-DES-CBC3-SHA",
"ECDH-ECDSA-AES128-SHA", "ECDH-ECDSA-AES256-SHA", 
-    "ECDHE-ECDSA-NULL-SHA", "ECDHE-ECDSA-RC4-SHA", "ECDHE-ECDSA-DES-CBC3-SHA", "ECDHE-ECDSA-AES128-SHA",
"ECDHE-ECDSA-AES256-SHA", "ECDH-RSA-NULL-SHA", 
-    "ECDH-RSA-RC4-SHA", "ECDH-RSA-DES-CBC3-SHA", "ECDH-RSA-AES128-SHA", "ECDH-RSA-AES256-SHA",
"ECDHE-RSA-NULL-SHA", "ECDHE-RSA-RC4-SHA", 
-    "ECDHE-RSA-DES-CBC3-SHA", "ECDHE-RSA-AES128-SHA", "ECDHE-RSA-AES256-SHA", "AECDH-NULL-SHA",
"AECDH-RC4-SHA", "AECDH-DES-CBC3-SHA", 
-    "AECDH-AES128-SHA", "AECDH-AES256-SHA", "PSK-RC4-SHA", "PSK-3DES-EDE-CBC-SHA", "PSK-AES128-CBC-SHA",
"PSK-AES256-CBC-SHA", "CAMELLIA128-SHA", 
-    "DH-DSS-CAMELLIA128-SHA", "DH-RSA-CAMELLIA128-SHA", "DHE-DSS-CAMELLIA128-SHA", "DHE-RSA-CAMELLIA128-SHA",
"ADH-CAMELLIA128-SHA", 
-    "CAMELLIA256-SHA", "DH-DSS-CAMELLIA256-SHA", "DH-RSA-CAMELLIA256-SHA", "DHE-DSS-CAMELLIA256-SHA",
"DHE-RSA-CAMELLIA256-SHA", "ADH-CAMELLIA256-SHA", 
-    "SEED-SHA", "DH-DSS-SEED-SHA", "DH-RSA-SEED-SHA", "DHE-DSS-SEED-SHA", "DHE-RSA-SEED-SHA",
"ADH-SEED-SHA"
-};
+char *openSSLNames[CIPHER_COUNT] = { "NULL-MD5", "NULL-SHA", "EXP-RC4-MD5", "RC4-MD5", "RC4-SHA",
"EXP-RC2-CBC-MD5", "IDEA-CBC-SHA", "EXP-DES-CBC-SHA", 
+    "DES-CBC-SHA", "DES-CBC3-SHA", "EXP-EDH-DSS-DES-CBC-SHA", "EDH-DSS-CBC-SHA", "EDH-DSS-DES-CBC3-SHA",
"EXP-EDH-RSA-DES-CBC-SHA", "EDH-RSA-DES-CBC-SHA", 
+    "EDH-RSA-DES-CBC3-SHA", "EXP-ADH-RC4-MD5", "ADH-RC4-MD5", "EXP-ADH-DES-CBC-SHA", "ADH-DES-CBC-SHA",
"ADH-DES-CBC3-SHA", "NULL-MD5", "NULL-SHA", 
+    "EXP-RC4-MD5", "RC4-MD5", "RC4-SHA", "EXP-RC2-CBC-MD5", "IDEA-CBC-SHA", "EXP-DES-CBC-SHA",
"DES-CBC-SHA", "DES-CBC3-SHA", "EXP-EDH-DSS-DES-CBC-SHA", 
+    "EDH-DSS-CBC-SHA", "EDH-DSS-DES-CBC3-SHA", "EXP-EDH-RSA-DES-CBC-SHA", "EDH-RSA-DES-CBC-SHA",
"EDH-RSA-DES-CBC3-SHA", "EXP-ADH-RC4-MD5", "ADH-RC4-MD5", 
+    "EXP-ADH-DES-CBC-SHA", "ADH-DES-CBC-SHA", "ADH-DES-CBC3-SHA", "AES128-SHA", "AES256-SHA",
"DHE-DSS-AES128-SHA", "DHE-DSS-AES256-SHA", 
+    "DHE-RSA-AES128-SHA", "DHE-RSA-AES256-SHA", "ADH-AES128-SHA", "ADH-AES256-SHA", "CAMELLIA128-SHA",
"CAMELLIA256-SHA", "DHE-DSS-CAMELLIA128-SHA", 
+    "DHE-DSS-CAMELLIA256-SHA", "DHE-RSA-CAMELLIA128-SHA", "DHE-RSA-CAMELLIA256-SHA", "ADH-CAMELLIA128-SHA",
"ADH-CAMELLIA256-SHA", "SEED-SHA", 
+    "DHE-DSS-SEED-SHA", "DHE-RSA-SEED-SHA", "ADH-SEED-SHA", "GOST94-GOST89-GOST89", "GOST2001-GOST89-GOST89",
"GOST94-NULL-GOST94", "GOST2001-NULL-GOST94", 
+    "EXP1024-DES-CBC-SHA", "EXP1024-RC4-SHA", "EXP1024-DHE-DSS-DES-CBC-SHA", "EXP1024-DHE-DSS-RC4-SHA",
"DHE-DSS-RC4-SHA", "RC4-MD5", "EXP-RC4-MD5", 
+    "RC2-MD5", "EXP-RC2-MD5", "IDEA-CBC-MD5", "DES-CBC-MD5", "DES-CBC3-MD5" };
 

Modified: harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/sslParameters.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/sslParameters.c?rev=987492&r1=987491&r2=987492&view=diff
==============================================================================
--- harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/sslParameters.c
(original)
+++ harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/native/jsse/shared/sslParameters.c
Fri Aug 20 13:02:23 2010
@@ -31,10 +31,11 @@ JNIEXPORT jobjectArray JNICALL Java_org_
 {
     SSL_CTX *context;
     SSL *ssl;
-    int i, count, ret;
+    int i, count, index, ret;
     jclass stringClass;
     jobjectArray stringArray; 
     STACK_OF(SSL_CIPHER) *ciphers;
+    jstring *jciphers;
 
     SSL_library_init();
     SSL_load_error_strings();
@@ -42,7 +43,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_
 
     context = SSL_CTX_new(SSLv23_method());
 
-    ret = SSL_CTX_set_cipher_list(context, "ALL");
+    ret = SSL_CTX_set_cipher_list(context, "SSLv2:SSLv3:TLSv1");
     if (ret<=0) {
        ERR_print_errors_fp(stderr);
     }
@@ -52,24 +53,32 @@ JNIEXPORT jobjectArray JNICALL Java_org_
     ciphers = SSL_get_ciphers(ssl);
     count = sk_num(&ciphers->stack);
 
-    stringClass = (*env)->FindClass(env, "java/lang/String");
-    stringArray = (*env)->NewObjectArray(env, count, stringClass, NULL);
+    jciphers = malloc(sizeof(jstring)*count);
 
+    index = 0;
     for (i=0; i<count; i++)
     {
         const char *cipherName = SSL_CIPHER_get_name(sk_value(&ciphers->stack, i));
         int j;
         for (j=0; j<CIPHER_COUNT; j++) {
             if (!strcmp(cipherName, openSSLNames[j])) {
-                jstring jcipherName;
-                jcipherName = (*env)->NewStringUTF(env, specNames[j]);
-                (*env)->SetObjectArrayElement(env, stringArray, i, jcipherName);
-                (*env)->DeleteLocalRef(env, jcipherName);
+                printf("match %s=%s\n", openSSLNames[j], specNames[j]);
+                jciphers[index] = (*env)->NewStringUTF(env, specNames[j]);           
    
+                index++;
                 break;
             }
         }
     }
 
+    stringClass = (*env)->FindClass(env, "java/lang/String");
+    stringArray = (*env)->NewObjectArray(env, index, stringClass, NULL);
+    for (i=0; i<index; i++)
+    {
+        (*env)->SetObjectArrayElement(env, stringArray, i, jciphers[i]);
+        (*env)->DeleteLocalRef(env, jciphers[i]);
+    }
+
+    free(jciphers);
     SSL_free(ssl);
     SSL_CTX_free(context);
 



Mime
View raw message