~ubuntu-branches/ubuntu/hardy/curl/hardy-updates

« back to all changes in this revision

Viewing changes to lib/ssluse.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-10-30 10:56:48 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061030105648-uo8q8w9xklb40b4k
Tags: 7.15.5-1ubuntu1
* Merge from debian unstable. Remaining Ubuntu changes:
  - debian/control: Drop libdb4.2 build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: ssluse.c,v 1.152 2006-06-09 12:07:34 bagder Exp $
 
21
 * $Id: ssluse.c,v 1.156 2006-07-19 21:14:02 yangtse Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
/*
1407
1407
    else {
1408
1408
      /* untreated error */
1409
1409
      unsigned long errdetail;
1410
 
      char error_buffer[120]; /* OpenSSL documents that this must be at least
1411
 
                                 120 bytes long. */
 
1410
      char error_buffer[256]; /* OpenSSL documents that this must be at least
 
1411
                                 256 bytes long. */
1412
1412
      CURLcode rc;
1413
1413
      const char *cert_problem = NULL;
1414
1414
 
1488
1488
  if(Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL)) {
1489
1489
    /* Since this is not a cached session ID, then we want to stach this one
1490
1490
       in the cache! */
1491
 
    SSL_SESSION *ssl_sessionid;
 
1491
    SSL_SESSION *our_ssl_sessionid;
1492
1492
#ifdef HAVE_SSL_GET1_SESSION
1493
 
    ssl_sessionid = SSL_get1_session(connssl->handle);
 
1493
    our_ssl_sessionid = SSL_get1_session(connssl->handle);
1494
1494
 
1495
1495
    /* SSL_get1_session() will increment the reference
1496
1496
       count and the session will stay in memory until explicitly freed with
1497
1497
       SSL_SESSION_free(3), regardless of its state.
1498
1498
       This function was introduced in openssl 0.9.5a. */
1499
1499
#else
1500
 
    ssl_sessionid = SSL_get_session(connssl->handle);
 
1500
    our_ssl_sessionid = SSL_get_session(connssl->handle);
1501
1501
 
1502
1502
    /* if SSL_get1_session() is unavailable, use SSL_get_session().
1503
1503
       This is an inferior option because the session can be flushed
1508
1508
       untested.
1509
1509
    */
1510
1510
#endif
1511
 
    retcode = Curl_ssl_addsessionid(conn, ssl_sessionid,
 
1511
    retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid,
1512
1512
                                    0 /* unknown size */);
1513
1513
    if(retcode) {
1514
1514
      failf(data, "failed to store ssl session");
1788
1788
 
1789
1789
size_t Curl_ossl_version(char *buffer, size_t size)
1790
1790
{
 
1791
#ifdef YASSL_VERSION
 
1792
  /* yassl provides an OpenSSL API compatiblity layer so it looks identical
 
1793
     to OpenSSL in all other aspects */
 
1794
  return snprintf(buffer, size, " yassl/%s", YASSL_VERSION);
 
1795
#else /* YASSL_VERSION */
 
1796
 
1791
1797
#if (SSLEAY_VERSION_NUMBER >= 0x905000)
1792
1798
  {
1793
1799
    char sub[2];
1800
1806
    }
1801
1807
    else {
1802
1808
      if(ssleay_value&0xff0) {
1803
 
        sub[0]=(char)((ssleay_value>>4)&0xff) + 'a' -1;
 
1809
        sub[0]=(char)(((ssleay_value>>4)&0xff) + 'a' -1);
1804
1810
      }
1805
1811
      else
1806
1812
        sub[0]='\0';
1838
1844
  }
1839
1845
#endif /* (SSLEAY_VERSION_NUMBER >= 0x900000) */
1840
1846
#endif /* SSLEAY_VERSION_NUMBER is less than 0.9.5 */
 
1847
 
 
1848
#endif /* YASSL_VERSION */
1841
1849
}
1842
1850
#endif /* USE_SSLEAY */