summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/src/ssl/s3_enc.c34
-rw-r--r--src/lib/libssl/src/ssl/ssl_locl.h4
-rw-r--r--src/lib/libssl/ssl_locl.h4
3 files changed, 3 insertions, 39 deletions
diff --git a/src/lib/libssl/src/ssl/s3_enc.c b/src/lib/libssl/src/ssl/s3_enc.c
index 06ce4b0fbb..ced1083497 100644
--- a/src/lib/libssl/src/ssl/s3_enc.c
+++ b/src/lib/libssl/src/ssl/s3_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_enc.c,v 1.65 2015/09/11 16:59:17 jsing Exp $ */ 1/* $OpenBSD: s3_enc.c,v 1.66 2015/09/11 17:01:19 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -469,38 +469,6 @@ ssl3_record_sequence_increment(unsigned char *seq)
469} 469}
470 470
471int 471int
472ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
473 int len)
474{
475 static const unsigned char *salt[3] = { "A", "BB", "CCC", };
476 unsigned char buf[EVP_MAX_MD_SIZE];
477 EVP_MD_CTX ctx;
478 int i, ret = 0;
479 unsigned int n;
480
481 EVP_MD_CTX_init(&ctx);
482 for (i = 0; i < 3; i++) {
483 if (!EVP_DigestInit_ex(&ctx, s->ctx->sha1, NULL))
484 return 0;
485 EVP_DigestUpdate(&ctx, salt[i], strlen((const char *)salt[i]));
486 EVP_DigestUpdate(&ctx, p, len);
487 EVP_DigestUpdate(&ctx, s->s3->client_random, SSL3_RANDOM_SIZE);
488 EVP_DigestUpdate(&ctx, s->s3->server_random, SSL3_RANDOM_SIZE);
489 EVP_DigestFinal_ex(&ctx, buf, &n);
490
491 if (!EVP_DigestInit_ex(&ctx, s->ctx->md5, NULL))
492 return 0;
493 EVP_DigestUpdate(&ctx, p, len);
494 EVP_DigestUpdate(&ctx, buf, n);
495 EVP_DigestFinal_ex(&ctx, out, &n);
496 out += n;
497 ret += n;
498 }
499 EVP_MD_CTX_cleanup(&ctx);
500 return (ret);
501}
502
503int
504ssl3_alert_code(int code) 472ssl3_alert_code(int code)
505{ 473{
506 switch (code) { 474 switch (code) {
diff --git a/src/lib/libssl/src/ssl/ssl_locl.h b/src/lib/libssl/src/ssl/ssl_locl.h
index 939808e3fb..ec30c9cb6a 100644
--- a/src/lib/libssl/src/ssl/ssl_locl.h
+++ b/src/lib/libssl/src/ssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.108 2015/09/11 16:59:17 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.109 2015/09/11 17:01:19 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -607,8 +607,6 @@ int ssl3_change_cipher_state(SSL *s, int which);
607void ssl3_cleanup_key_block(SSL *s); 607void ssl3_cleanup_key_block(SSL *s);
608int ssl3_do_write(SSL *s, int type); 608int ssl3_do_write(SSL *s, int type);
609int ssl3_send_alert(SSL *s, int level, int desc); 609int ssl3_send_alert(SSL *s, int level, int desc);
610int ssl3_generate_master_secret(SSL *s, unsigned char *out,
611 unsigned char *p, int len);
612int ssl3_get_req_cert_type(SSL *s, unsigned char *p); 610int ssl3_get_req_cert_type(SSL *s, unsigned char *p);
613long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok); 611long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok);
614int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen); 612int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen);
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index 939808e3fb..ec30c9cb6a 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.108 2015/09/11 16:59:17 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.109 2015/09/11 17:01:19 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -607,8 +607,6 @@ int ssl3_change_cipher_state(SSL *s, int which);
607void ssl3_cleanup_key_block(SSL *s); 607void ssl3_cleanup_key_block(SSL *s);
608int ssl3_do_write(SSL *s, int type); 608int ssl3_do_write(SSL *s, int type);
609int ssl3_send_alert(SSL *s, int level, int desc); 609int ssl3_send_alert(SSL *s, int level, int desc);
610int ssl3_generate_master_secret(SSL *s, unsigned char *out,
611 unsigned char *p, int len);
612int ssl3_get_req_cert_type(SSL *s, unsigned char *p); 610int ssl3_get_req_cert_type(SSL *s, unsigned char *p);
613long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok); 611long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok);
614int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen); 612int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen);