~ubuntu-branches/ubuntu/quantal/nss/quantal-updates

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/ssl/sslreveal.c

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-03-25 13:46:06 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100325134606-bl6liuok2w9l7snv
Tags: 3.12.6-0ubuntu1
* New upstream release 3.12.6 RTM (NSS_3_12_6_RTM)
  - fixes CVE-2009-3555 aka US-CERT VU#120541
* Adjust patches to changed upstream code base
  - update debian/patches/38_kbsd.patch
  - update debian/patches/38_mips64_build.patch
  - update debian/patches/85_security_load.patch
* Remove patches that are merged upstream
  - delete debian/patches/91_nonexec_stack.patch
  - update debian/patches/series
* Bump nspr dependency to 4.8
  - update debian/control
* Add new symbols for 3.12.6
  - update debian/libnss3-1d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 * the terms of any one of the MPL, the GPL or the LGPL.
37
37
 *
38
38
 * ***** END LICENSE BLOCK ***** */
39
 
/* $Id: sslreveal.c,v 1.4 2004/04/27 23:04:39 gerv%gerv.net Exp $ */
 
39
/* $Id: sslreveal.c,v 1.7 2010/02/04 03:21:11 wtc%google.com Exp $ */
40
40
 
41
41
#include "cert.h"
42
42
#include "ssl.h"
82
82
 
83
83
 
84
84
/* given PRFileDesc, returns a pointer to the URL associated with the socket
85
 
 * the caller should free url when done  
 
85
 * the caller should free url when done
86
86
 */
87
87
char * 
88
88
SSL_RevealURL(PRFileDesc * fd)
98
98
  return url;
99
99
}
100
100
 
 
101
 
 
102
/* given PRFileDesc, returns status information related to extensions 
 
103
 * negotiated with peer during the handshake.
 
104
 */
 
105
 
 
106
SECStatus
 
107
SSL_HandshakeNegotiatedExtension(PRFileDesc * socket, 
 
108
                                 SSLExtensionType extId,
 
109
                                 PRBool *pYes)
 
110
{
 
111
  /* some decisions derived from SSL_GetChannelInfo */
 
112
  sslSocket * sslsocket = NULL;
 
113
  SECStatus rv = SECFailure;
 
114
 
 
115
  if (!pYes)
 
116
    return rv;
 
117
 
 
118
  sslsocket = ssl_FindSocket(socket);
 
119
 
 
120
  /* according to public API SSL_GetChannelInfo, this doesn't need a lock */
 
121
  if (sslsocket && sslsocket->opt.useSecurity && sslsocket->firstHsDone) {
 
122
    if (sslsocket->ssl3.initialized) { /* SSL3 and TLS */
 
123
      /* now we know this socket went through ssl3_InitState() and
 
124
       * ss->xtnData got initialized, which is the only member accessed by
 
125
       * ssl3_ExtensionNegotiated();
 
126
       * Member xtnData appears to get accessed in functions that handle
 
127
       * the handshake (hello messages and extension sending),
 
128
       * therefore the handshake lock should be sufficient.
 
129
       */
 
130
      ssl_GetSSL3HandshakeLock(sslsocket);
 
131
      *pYes = ssl3_ExtensionNegotiated(sslsocket, extId);
 
132
      ssl_ReleaseSSL3HandshakeLock(sslsocket);
 
133
      rv = SECSuccess;
 
134
    }
 
135
  }
 
136
 
 
137
  return rv;
 
138
}