| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/ssl/ssl_cipher_suite_names.h" | 5 #include "net/ssl/ssl_cipher_suite_names.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <openssl/ssl.h> | 9 #include <openssl/ssl.h> |
| 10 | 10 |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 return false; | 459 return false; |
| 460 } | 460 } |
| 461 | 461 |
| 462 // Only AEADs allowed. | 462 // Only AEADs allowed. |
| 463 if (mac != kAEADMACValue) | 463 if (mac != kAEADMACValue) |
| 464 return false; | 464 return false; |
| 465 | 465 |
| 466 return true; | 466 return true; |
| 467 } | 467 } |
| 468 | 468 |
| 469 const char* ECCurveName(uint16_t cipher_suite, int key_exchange_info) { | |
| 470 int key_exchange, cipher, mac; | |
| 471 if (!GetCipherProperties(cipher_suite, &key_exchange, &cipher, &mac)) | |
| 472 return nullptr; | |
| 473 switch (key_exchange) { | |
| 474 case 14: // ECDHE_ECDSA | |
| 475 case 16: // ECDHE_RSA | |
| 476 case 20: // ECDHE_PSK | |
| 477 break; | |
| 478 default: | |
| 479 return nullptr; | |
| 480 } | |
| 481 return SSL_get_curve_name(key_exchange_info); | |
| 482 } | |
| 483 | |
| 484 } // namespace net | 469 } // namespace net |
| OLD | NEW |