t1_trce.c (331638) | t1_trce.c (337982) |
---|---|
1/* ssl/t1_trce.c */ 2/* 3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 4 * project. 5 */ 6/* ==================================================================== | 1/* ssl/t1_trce.c */ 2/* 3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 4 * project. 5 */ 6/* ==================================================================== |
7 * Copyright (c) 2012 The OpenSSL Project. All rights reserved. | 7 * Copyright (c) 2012-2018 The OpenSSL Project. All rights reserved. |
8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * --- 624 unchanged lines hidden (view full) --- 640 const unsigned char *msg, size_t msglen) 641{ 642 size_t extslen; 643 BIO_indent(bio, indent, 80); 644 if (msglen == 0) { 645 BIO_puts(bio, "No Extensions\n"); 646 return 1; 647 } | 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * --- 624 unchanged lines hidden (view full) --- 640 const unsigned char *msg, size_t msglen) 641{ 642 size_t extslen; 643 BIO_indent(bio, indent, 80); 644 if (msglen == 0) { 645 BIO_puts(bio, "No Extensions\n"); 646 return 1; 647 } |
648 if (msglen < 2) 649 return 0; |
|
648 extslen = (msg[0] << 8) | msg[1]; 649 if (extslen != msglen - 2) 650 return 0; 651 msg += 2; 652 msglen = extslen; 653 BIO_printf(bio, "extensions, length = %d\n", (int)msglen); 654 while (msglen > 0) { 655 int extype; --- 360 unchanged lines hidden (view full) --- 1016 ssl_trace_str(msg[1], ssl_sig_tbl), msg[0], msg[1]); 1017 xlen -= 2; 1018 msg += 2; 1019 } 1020 msg += xlen; 1021 msglen -= xlen + 2; 1022 1023 skip_sig: | 650 extslen = (msg[0] << 8) | msg[1]; 651 if (extslen != msglen - 2) 652 return 0; 653 msg += 2; 654 msglen = extslen; 655 BIO_printf(bio, "extensions, length = %d\n", (int)msglen); 656 while (msglen > 0) { 657 int extype; --- 360 unchanged lines hidden (view full) --- 1018 ssl_trace_str(msg[1], ssl_sig_tbl), msg[0], msg[1]); 1019 xlen -= 2; 1020 msg += 2; 1021 } 1022 msg += xlen; 1023 msglen -= xlen + 2; 1024 1025 skip_sig: |
1026 if (msglen < 2) 1027 return 0; |
|
1024 xlen = (msg[0] << 8) | msg[1]; 1025 BIO_indent(bio, indent, 80); 1026 if (msglen < xlen + 2) 1027 return 0; 1028 msg += 2; 1029 msglen -= 2; 1030 BIO_printf(bio, "certificate_authorities (len=%d)\n", (int)xlen); 1031 while (xlen > 0) { --- 172 unchanged lines hidden (view full) --- 1204 ssl_print_hex(bio, 0, 1205 ssl_trace_str(content_type, ssl_crypto_tbl), 1206 msg, msglen); 1207 return; 1208 } 1209 switch (content_type) { 1210 case SSL3_RT_HEADER: 1211 { | 1028 xlen = (msg[0] << 8) | msg[1]; 1029 BIO_indent(bio, indent, 80); 1030 if (msglen < xlen + 2) 1031 return 0; 1032 msg += 2; 1033 msglen -= 2; 1034 BIO_printf(bio, "certificate_authorities (len=%d)\n", (int)xlen); 1035 while (xlen > 0) { --- 172 unchanged lines hidden (view full) --- 1208 ssl_print_hex(bio, 0, 1209 ssl_trace_str(content_type, ssl_crypto_tbl), 1210 msg, msglen); 1211 return; 1212 } 1213 switch (content_type) { 1214 case SSL3_RT_HEADER: 1215 { |
1212 int hvers = msg[1] << 8 | msg[2]; | 1216 int hvers; 1217 1218 /* avoid overlapping with length at the end of buffer */ 1219 if (msglen < (SSL_IS_DTLS(ssl) ? 13 : 5)) { 1220 BIO_puts(bio, write_p ? "Sent" : "Received"); 1221 ssl_print_hex(bio, 0, " too short message", msg, msglen); 1222 break; 1223 } 1224 hvers = msg[1] << 8 | msg[2]; |
1213 BIO_puts(bio, write_p ? "Sent" : "Received"); 1214 BIO_printf(bio, " Record\nHeader:\n Version = %s (0x%x)\n", 1215 ssl_trace_str(hvers, ssl_version_tbl), hvers); 1216 if (SSL_IS_DTLS(ssl)) { 1217 BIO_printf(bio, 1218 " epoch=%d, sequence_number=%04x%04x%04x\n", 1219 (msg[3] << 8 | msg[4]), 1220 (msg[5] << 8 | msg[6]), --- 48 unchanged lines hidden --- | 1225 BIO_puts(bio, write_p ? "Sent" : "Received"); 1226 BIO_printf(bio, " Record\nHeader:\n Version = %s (0x%x)\n", 1227 ssl_trace_str(hvers, ssl_version_tbl), hvers); 1228 if (SSL_IS_DTLS(ssl)) { 1229 BIO_printf(bio, 1230 " epoch=%d, sequence_number=%04x%04x%04x\n", 1231 (msg[3] << 8 | msg[4]), 1232 (msg[5] << 8 | msg[6]), --- 48 unchanged lines hidden --- |