| OLD | NEW |
| 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 /* | 2 /* |
| 3 * SSL3 Protocol | 3 * SSL3 Protocol |
| 4 * | 4 * |
| 5 * This Source Code Form is subject to the terms of the Mozilla Public | 5 * This Source Code Form is subject to the terms of the Mozilla Public |
| 6 * License, v. 2.0. If a copy of the MPL was not distributed with this | 6 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 8 /* $Id$ */ | 8 /* $Id$ */ |
| 9 | 9 |
| 10 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ | 10 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ |
| (...skipping 9891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9902 | 9902 |
| 9903 /* called from ssl3_HandleServerHelloDone | 9903 /* called from ssl3_HandleServerHelloDone |
| 9904 */ | 9904 */ |
| 9905 static SECStatus | 9905 static SECStatus |
| 9906 ssl3_SendNextProto(sslSocket *ss) | 9906 ssl3_SendNextProto(sslSocket *ss) |
| 9907 { | 9907 { |
| 9908 SECStatus rv; | 9908 SECStatus rv; |
| 9909 int padding_len; | 9909 int padding_len; |
| 9910 static const unsigned char padding[32] = {0}; | 9910 static const unsigned char padding[32] = {0}; |
| 9911 | 9911 |
| 9912 if (ss->ssl3.nextProto.len == 0) | 9912 if (ss->ssl3.nextProto.len == 0 || |
| 9913 ss->ssl3.nextProtoState == SSL_NEXT_PROTO_SELECTED) { |
| 9913 return SECSuccess; | 9914 return SECSuccess; |
| 9915 } |
| 9914 | 9916 |
| 9915 PORT_Assert( ss->opt.noLocks || ssl_HaveXmitBufLock(ss)); | 9917 PORT_Assert( ss->opt.noLocks || ssl_HaveXmitBufLock(ss)); |
| 9916 PORT_Assert( ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss)); | 9918 PORT_Assert( ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss)); |
| 9917 | 9919 |
| 9918 padding_len = 32 - ((ss->ssl3.nextProto.len + 2) % 32); | 9920 padding_len = 32 - ((ss->ssl3.nextProto.len + 2) % 32); |
| 9919 | 9921 |
| 9920 rv = ssl3_AppendHandshakeHeader(ss, next_proto, ss->ssl3.nextProto.len + | 9922 rv = ssl3_AppendHandshakeHeader(ss, next_proto, ss->ssl3.nextProto.len + |
| 9921 2 + padding_len); | 9923 2 + padding_len); |
| 9922 if (rv != SECSuccess) { | 9924 if (rv != SECSuccess) { |
| 9923 return rv; /* error code set by AppendHandshakeHeader */ | 9925 return rv; /* error code set by AppendHandshakeHeader */ |
| (...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11978 PORT_Free(ss->ssl3.hs.recvdFragments.buf); | 11980 PORT_Free(ss->ssl3.hs.recvdFragments.buf); |
| 11979 } | 11981 } |
| 11980 } | 11982 } |
| 11981 | 11983 |
| 11982 ss->ssl3.initialized = PR_FALSE; | 11984 ss->ssl3.initialized = PR_FALSE; |
| 11983 | 11985 |
| 11984 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); | 11986 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); |
| 11985 } | 11987 } |
| 11986 | 11988 |
| 11987 /* End of ssl3con.c */ | 11989 /* End of ssl3con.c */ |
| OLD | NEW |