X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=ssl%2Ft1_enc.c;h=3a349920d9cd2144e73472f43b98f46fc59c74cf;hb=4c3296960de32e5abfbb8f4703a2ce624d82669f;hp=011ef3aacaa97dc68c1ef17da10c303cab7db2ba;hpb=4fe55663df33ca6afc683b7e76ef08ab18fcb188;p=oweals%2Fopenssl.git diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 011ef3aaca..3a349920d9 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -141,6 +141,9 @@ #include #include #include +#ifdef KSSL_DEBUG +#include +#endif /* seed1 through seed5 are virtually concatenated */ static void tls1_P_hash(const EVP_MD *md, const unsigned char *sec, @@ -790,8 +793,8 @@ int tls1_final_finish_mac(SSL *s, { if (mask & s->s3->tmp.new_cipher->algorithm2) { - int hashsize = EVP_MD_size(md); - if ((size_t)hashsize > (sizeof buf - (size_t)(q-buf))) + unsigned int hashsize = EVP_MD_size(md); + if (hashsize > (sizeof buf - (size_t)(q-buf))) { /* internal error: 'buf' is too small for this cipersuite! */ err = 1; @@ -878,9 +881,8 @@ int tls1_mac(SSL *ssl, unsigned char *md, int send) EVP_DigestSignUpdate(mac_ctx,buf,5); EVP_DigestSignUpdate(mac_ctx,rec->input,rec->length); - if (stream_mac) EVP_MD_CTX_copy(&hmac,hash); - EVP_DigestSignFinal(&hmac,md,&md_size); - EVP_MD_CTX_cleanup(&hmac); + EVP_DigestSignFinal(mac_ctx,md,&md_size); + if (!stream_mac) EVP_MD_CTX_cleanup(&hmac); #ifdef TLS_DEBUG printf("sec="); {unsigned int z; for (z=0; z