summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_both.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/s3_both.c')
-rw-r--r--src/lib/libssl/s3_both.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/src/lib/libssl/s3_both.c b/src/lib/libssl/s3_both.c
index 64d317b7ac..2ecfbb77cb 100644
--- a/src/lib/libssl/s3_both.c
+++ b/src/lib/libssl/s3_both.c
@@ -108,6 +108,11 @@
108 * Hudson (tjh@cryptsoft.com). 108 * Hudson (tjh@cryptsoft.com).
109 * 109 *
110 */ 110 */
111/* ====================================================================
112 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
113 * ECC cipher suite support in OpenSSL originally developed by
114 * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
115 */
111 116
112#include <limits.h> 117#include <limits.h>
113#include <string.h> 118#include <string.h>
@@ -192,7 +197,7 @@ int ssl3_get_finished(SSL *s, int a, int b)
192 * change cipher spec message and is in s->s3->tmp.peer_finish_md 197 * change cipher spec message and is in s->s3->tmp.peer_finish_md
193 */ 198 */
194 199
195 n=ssl3_get_message(s, 200 n=s->method->ssl_get_message(s,
196 a, 201 a,
197 b, 202 b,
198 SSL3_MT_FINISHED, 203 SSL3_MT_FINISHED,
@@ -386,8 +391,8 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
386 { 391 {
387 while (s->init_num < 4) 392 while (s->init_num < 4)
388 { 393 {
389 i=ssl3_read_bytes(s,SSL3_RT_HANDSHAKE,&p[s->init_num], 394 i=s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE,
390 4 - s->init_num, 0); 395 &p[s->init_num],4 - s->init_num, 0);
391 if (i <= 0) 396 if (i <= 0)
392 { 397 {
393 s->rwstate=SSL_READING; 398 s->rwstate=SSL_READING;
@@ -467,7 +472,7 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
467 n = s->s3->tmp.message_size - s->init_num; 472 n = s->s3->tmp.message_size - s->init_num;
468 while (n > 0) 473 while (n > 0)
469 { 474 {
470 i=ssl3_read_bytes(s,SSL3_RT_HANDSHAKE,&p[s->init_num],n,0); 475 i=s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE,&p[s->init_num],n,0);
471 if (i <= 0) 476 if (i <= 0)
472 { 477 {
473 s->rwstate=SSL_READING; 478 s->rwstate=SSL_READING;
@@ -492,7 +497,7 @@ err:
492int ssl_cert_type(X509 *x, EVP_PKEY *pkey) 497int ssl_cert_type(X509 *x, EVP_PKEY *pkey)
493 { 498 {
494 EVP_PKEY *pk; 499 EVP_PKEY *pk;
495 int ret= -1,i,j; 500 int ret= -1,i;
496 501
497 if (pkey == NULL) 502 if (pkey == NULL)
498 pk=X509_get_pubkey(x); 503 pk=X509_get_pubkey(x);
@@ -504,35 +509,17 @@ int ssl_cert_type(X509 *x, EVP_PKEY *pkey)
504 if (i == EVP_PKEY_RSA) 509 if (i == EVP_PKEY_RSA)
505 { 510 {
506 ret=SSL_PKEY_RSA_ENC; 511 ret=SSL_PKEY_RSA_ENC;
507 if (x != NULL)
508 {
509 j=X509_get_ext_count(x);
510 /* check to see if this is a signing only certificate */
511 /* EAY EAY EAY EAY */
512 }
513 } 512 }
514 else if (i == EVP_PKEY_DSA) 513 else if (i == EVP_PKEY_DSA)
515 { 514 {
516 ret=SSL_PKEY_DSA_SIGN; 515 ret=SSL_PKEY_DSA_SIGN;
517 } 516 }
518 else if (i == EVP_PKEY_DH) 517#ifndef OPENSSL_NO_EC
518 else if (i == EVP_PKEY_EC)
519 { 519 {
520 /* if we just have a key, we needs to be guess */ 520 ret = SSL_PKEY_ECC;
521
522 if (x == NULL)
523 ret=SSL_PKEY_DH_DSA;
524 else
525 {
526 j=X509_get_signature_type(x);
527 if (j == EVP_PKEY_RSA)
528 ret=SSL_PKEY_DH_RSA;
529 else if (j== EVP_PKEY_DSA)
530 ret=SSL_PKEY_DH_DSA;
531 else ret= -1;
532 }
533 } 521 }
534 else 522#endif
535 ret= -1;
536 523
537err: 524err:
538 if(!pkey) EVP_PKEY_free(pk); 525 if(!pkey) EVP_PKEY_free(pk);