Changeset 2990


Ignore:
Timestamp:
Nov 6, 2009 1:31:37 PM (10 years ago)
Author:
nanang
Message:

Ticket #957:

  • Updated Symbian PJLIB test build setting to enable SSL sock test.
  • Fixed ciphers enumeration in Symbian SSL sock.
  • Fixed OpenSSL SSL sock to avoid initializing OpenSSL multiple times.
  • Fixed SSL unit test to avoid divide-by-zero in setting random seed.
Location:
pjproject/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/build.symbian/pjlib_test.mmp

    r2873 r2990  
    4747SOURCE  sock.c 
    4848SOURCE  sock_perf.c 
     49SOURCE  ssl_sock.c 
    4950SOURCE  string.c 
    5051SOURCE  test_wrap.cpp 
     
    6970SYSTEMINCLUDE   \epoc32\include\libc 
    7071 
    71 LIBRARY         esock.lib insock.lib charconv.lib euser.lib estlib.lib  
     72LIBRARY         esock.lib insock.lib charconv.lib euser.lib estlib.lib securesocket.lib  
    7273#ifdef WINSCW 
    7374STATICLIBRARY   eexe.lib ecrt0.lib 
     
    7778EPOCSTACKSIZE           32768 
    7879 
     80CAPABILITY      NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment 
  • pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c

    r2989 r2990  
    249249    errstr.ptr = buf; 
    250250    errstr.slen = pj_ansi_snprintf(buf, bufsize,  
    251                                    "Unknown OpenSSL error %d", 
     251                                   "Unknown OpenSSL error %ul", 
    252252                                   ssl_err); 
    253253 
     
    268268static pj_status_t init_openssl(void) 
    269269{ 
    270     if (++openssl_init_count != 1) 
     270    if (openssl_init_count) 
    271271        return PJ_SUCCESS; 
     272 
     273    openssl_init_count = 1; 
    272274 
    273275    /* Register error subsystem */ 
     
    335337static void shutdown_openssl(void) 
    336338{ 
    337     if (--openssl_init_count != 0) 
    338         return; 
     339    PJ_UNUSED_ARG(openssl_init_count); 
    339340} 
    340341 
  • pjproject/trunk/pjlib/src/pj/ssl_sock_symbian.cpp

    r2970 r2990  
    448448                ciphers_num_ = PJ_ARRAY_SIZE(ciphers_); 
    449449            for (i = 0; i < ciphers_num_; ++i) 
    450                 ciphers_[i] = (pj_ssl_cipher)ciphers_buf[i*2]; 
     450                ciphers_[i] = (pj_ssl_cipher)(ciphers_buf[i*2]*10 +  
     451                                              ciphers_buf[i*2+1]); 
    451452        } 
    452453         
  • pjproject/trunk/pjlib/src/pjlib-test/ssl_sock.c

    r2986 r2990  
    611611 
    612612        pj_gettimeofday(&now); 
    613         pj_srand((pj_rand()%now.sec) * (pj_rand()%now.msec)); 
     613        pj_srand((unsigned)now.sec); 
    614614        state_cli.send_str_len = (pj_rand() % 5 + 1) * 1024 + pj_rand() % 1024; 
    615615    } 
     
    10071007 
    10081008        pj_gettimeofday(&now); 
    1009         pj_srand((pj_rand()%now.sec) * (pj_rand()%now.msec)); 
     1009        pj_srand((unsigned)now.sec); 
    10101010    } 
    10111011 
Note: See TracChangeset for help on using the changeset viewer.