| OLD | NEW |
| 1 /* | 1 /* |
| 2 * SSL3 Protocol | 2 * SSL3 Protocol |
| 3 * | 3 * |
| 4 * ***** BEGIN LICENSE BLOCK ***** | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
| 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 6 * | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 7 * The contents of this file are subject to the Mozilla Public License Version | |
| 8 * 1.1 (the "License"); you may not use this file except in compliance with | |
| 9 * the License. You may obtain a copy of the License at | |
| 10 * http://www.mozilla.org/MPL/ | |
| 11 * | |
| 12 * Software distributed under the License is distributed on an "AS IS" basis, | |
| 13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 * for the specific language governing rights and limitations under the | |
| 15 * License. | |
| 16 * | |
| 17 * The Original Code is the Netscape security libraries. | |
| 18 * | |
| 19 * The Initial Developer of the Original Code is | |
| 20 * Netscape Communications Corporation. | |
| 21 * Portions created by the Initial Developer are Copyright (C) 1994-2000 | |
| 22 * the Initial Developer. All Rights Reserved. | |
| 23 * | |
| 24 * Contributor(s): | |
| 25 * Dr Vipul Gupta <vipul.gupta@sun.com> and | |
| 26 * Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories | |
| 27 * | |
| 28 * Alternatively, the contents of this file may be used under the terms of | |
| 29 * either the GNU General Public License Version 2 or later (the "GPL"), or | |
| 30 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | |
| 31 * in which case the provisions of the GPL or the LGPL are applicable instead | |
| 32 * of those above. If you wish to allow use of your version of this file only | |
| 33 * under the terms of either the GPL or the LGPL, and not to allow others to | |
| 34 * use your version of this file under the terms of the MPL, indicate your | |
| 35 * decision by deleting the provisions above and replace them with the notice | |
| 36 * and other provisions required by the GPL or the LGPL. If you do not delete | |
| 37 * the provisions above, a recipient may use your version of this file under | |
| 38 * the terms of any one of the MPL, the GPL or the LGPL. | |
| 39 * | |
| 40 * ***** END LICENSE BLOCK ***** */ | |
| 41 | 7 |
| 42 /* ECC code moved here from ssl3con.c */ | 8 /* ECC code moved here from ssl3con.c */ |
| 43 /* $Id: ssl3ecc.c,v 1.26 2012/02/13 17:19:40 kaie%kuix.de Exp $ */ | 9 /* $Id: ssl3ecc.c,v 1.29 2012/06/11 02:38:30 emaldona%redhat.com Exp $ */ |
| 44 | 10 |
| 45 #include "nss.h" | 11 #include "nss.h" |
| 46 #include "cert.h" | 12 #include "cert.h" |
| 47 #include "ssl.h" | 13 #include "ssl.h" |
| 48 #include "cryptohi.h" /* for DSAU_ stuff */ | 14 #include "cryptohi.h" /* for DSAU_ stuff */ |
| 49 #include "keyhi.h" | 15 #include "keyhi.h" |
| 50 #include "secder.h" | 16 #include "secder.h" |
| 51 #include "secitem.h" | 17 #include "secitem.h" |
| 52 | 18 |
| 53 #include "sslimpl.h" | 19 #include "sslimpl.h" |
| 54 #include "sslproto.h" | 20 #include "sslproto.h" |
| 55 #include "sslerr.h" | 21 #include "sslerr.h" |
| 56 #include "prtime.h" | 22 #include "prtime.h" |
| 57 #include "prinrval.h" | 23 #include "prinrval.h" |
| 58 #include "prerror.h" | 24 #include "prerror.h" |
| 59 #include "pratom.h" | 25 #include "pratom.h" |
| 60 #include "prthread.h" | 26 #include "prthread.h" |
| 61 #include "prinit.h" | 27 #include "prinit.h" |
| 62 | 28 |
| 63 #include "pk11func.h" | 29 #include "pk11func.h" |
| 64 #include "secmod.h" | 30 #include "secmod.h" |
| 65 #include "ec.h" | |
| 66 #include "blapi.h" | |
| 67 | 31 |
| 68 #include <stdio.h> | 32 #include <stdio.h> |
| 69 | 33 |
| 70 #ifdef NSS_ENABLE_ECC | 34 #ifdef NSS_ENABLE_ECC |
| 71 | 35 |
| 36 /* |
| 37 * In NSS 3.13.2 the definition of the EC_POINT_FORM_UNCOMPRESSED macro |
| 38 * was moved from the internal header ec.h to the public header blapit.h. |
| 39 * Define the macro here when compiling against older system NSS headers. |
| 40 */ |
| 41 #ifndef EC_POINT_FORM_UNCOMPRESSED |
| 42 #define EC_POINT_FORM_UNCOMPRESSED 0x04 |
| 43 #endif |
| 44 |
| 72 #ifndef PK11_SETATTRS | 45 #ifndef PK11_SETATTRS |
| 73 #define PK11_SETATTRS(x,id,v,l) (x)->type = (id); \ | 46 #define PK11_SETATTRS(x,id,v,l) (x)->type = (id); \ |
| 74 (x)->pValue=(v); (x)->ulValueLen = (l); | 47 (x)->pValue=(v); (x)->ulValueLen = (l); |
| 75 #endif | 48 #endif |
| 76 | 49 |
| 77 #define SSL_GET_SERVER_PUBLIC_KEY(sock, type) \ | 50 #define SSL_GET_SERVER_PUBLIC_KEY(sock, type) \ |
| 78 (ss->serverCerts[type].serverKeyPair ? \ | 51 (ss->serverCerts[type].serverKeyPair ? \ |
| 79 ss->serverCerts[type].serverKeyPair->pubKey : NULL) | 52 ss->serverCerts[type].serverKeyPair->pubKey : NULL) |
| 80 | 53 |
| 81 #define SSL_IS_CURVE_NEGOTIATED(curvemsk, curveName) \ | 54 #define SSL_IS_CURVE_NEGOTIATED(curvemsk, curveName) \ |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 ssl3_DisableECCSuites(ss, ecdhe_ecdsa_suites); | 1158 ssl3_DisableECCSuites(ss, ecdhe_ecdsa_suites); |
| 1186 return SECFailure; | 1159 return SECFailure; |
| 1187 | 1160 |
| 1188 loser: | 1161 loser: |
| 1189 /* no common curve supported */ | 1162 /* no common curve supported */ |
| 1190 ssl3_DisableECCSuites(ss, ecSuites); | 1163 ssl3_DisableECCSuites(ss, ecSuites); |
| 1191 return SECFailure; | 1164 return SECFailure; |
| 1192 } | 1165 } |
| 1193 | 1166 |
| 1194 #endif /* NSS_ENABLE_ECC */ | 1167 #endif /* NSS_ENABLE_ECC */ |
| OLD | NEW |