Ignore:
Timestamp:
Feb 25, 2010 11:58:19 AM (12 years ago)
Author:
nanang
Message:

More ticket #1032:

  • Updated transport state notification callback to return void.
  • Updated transport state enum to only contain connected and disconnected, no more bitmask value.
  • Added direction field to SIP transport.
  • Removed remote hostname hash from transport key.
  • Updated cert info dump to return -1 when buffer is insufficient.
  • Added new error code PJSIP_TLS_ECERTVERIF.
  • Updated get_cert_name() in ssl_sock_symbian.c to use heap buffer instead of stack.
  • Minors, e.g: added prefix PJ in cipher types, docs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ssl_sock_symbian.cpp

    r3106 r3110  
    445445 
    446446 
    447 static pj_str_t get_cert_name(pj_pool_t *pool, 
     447static pj_str_t get_cert_name(char *buf, unsigned buf_len, 
    448448                              const CX500DistinguishedName &name) 
    449449{ 
    450450    TInt i; 
    451     char buf[1024]; 
    452451    TUint8 *p; 
    453     TInt l = sizeof(buf); 
     452    TInt l = buf_len; 
    454453     
    455454    p = (TUint8*)buf; 
     
    480479    } 
    481480     
    482     pj_str_t src, res; 
    483     pj_strset(&src, buf, sizeof(buf) - l); 
    484     pj_strdup(pool, &res, &src); 
    485      
    486     return res; 
     481    pj_str_t src; 
     482    pj_strset(&src, buf, buf_len - l); 
     483     
     484    return src; 
    487485} 
    488486                             
     
    492490                          const CX509Certificate *x) 
    493491{ 
     492    enum { tmp_buf_len = 512 }; 
     493    char *tmp_buf; 
    494494    unsigned len; 
    495495     
    496496    pj_assert(pool && ci && x); 
    497497     
     498    /* Init */ 
     499    tmp_buf = new char[tmp_buf_len]; 
    498500    pj_bzero(ci, sizeof(*ci)); 
    499501     
     
    519521            pj_strset(&ci->subject.cn, (char*)ptr8.Ptr(), ptr8.Length()); 
    520522        } 
    521         ci->subject.info = get_cert_name(pool, x->SubjectName()); 
     523        pj_str_t tmp = get_cert_name(tmp_buf, tmp_buf_len, 
     524                                     x->SubjectName()); 
     525        pj_strdup(pool, &ci->subject.info, &tmp); 
    522526    } 
    523527 
     
    533537            pj_strset(&ci->issuer.cn, (char*)ptr8.Ptr(), ptr8.Length()); 
    534538        } 
    535         ci->issuer.info = get_cert_name(pool, x->IssuerName()); 
     539        pj_str_t tmp = get_cert_name(tmp_buf, tmp_buf_len, 
     540                                     x->IssuerName()); 
     541        pj_strdup(pool, &ci->issuer.info, &tmp); 
    536542    } 
    537543     
     
    544550    valid_period.Finish().SecondsFrom(base_time, tmp_sec); 
    545551    ci->validity.end.sec = tmp_sec.Int(); 
     552     
     553    /* Deinit */ 
     554    delete [] tmp_buf; 
    546555} 
    547556 
Note: See TracChangeset for help on using the changeset viewer.