Deleted Added
full compact
s_client.c (325337) s_client.c (326663)
1/* apps/s_client.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 616 unchanged lines hidden (view full) ---

625static int serverinfo_cli_parse_cb(SSL *s, unsigned int ext_type,
626 const unsigned char *in, size_t inlen,
627 int *al, void *arg)
628{
629 char pem_name[100];
630 unsigned char ext_buf[4 + 65536];
631
632 /* Reconstruct the type/len fields prior to extension data */
1/* apps/s_client.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 616 unchanged lines hidden (view full) ---

625static int serverinfo_cli_parse_cb(SSL *s, unsigned int ext_type,
626 const unsigned char *in, size_t inlen,
627 int *al, void *arg)
628{
629 char pem_name[100];
630 unsigned char ext_buf[4 + 65536];
631
632 /* Reconstruct the type/len fields prior to extension data */
633 ext_buf[0] = ext_type >> 8;
634 ext_buf[1] = ext_type & 0xFF;
635 ext_buf[2] = inlen >> 8;
636 ext_buf[3] = inlen & 0xFF;
633 inlen &= 0xffff; /* for formal memcpy correctness */
634 ext_buf[0] = (unsigned char)(ext_type >> 8);
635 ext_buf[1] = (unsigned char)(ext_type);
636 ext_buf[2] = (unsigned char)(inlen >> 8);
637 ext_buf[3] = (unsigned char)(inlen);
637 memcpy(ext_buf + 4, in, inlen);
638
639 BIO_snprintf(pem_name, sizeof(pem_name), "SERVERINFO FOR EXTENSION %d",
640 ext_type);
641 PEM_write_bio(bio_c_out, pem_name, "", ext_buf, 4 + inlen);
642 return 1;
643}
644

--- 1719 unchanged lines hidden ---
638 memcpy(ext_buf + 4, in, inlen);
639
640 BIO_snprintf(pem_name, sizeof(pem_name), "SERVERINFO FOR EXTENSION %d",
641 ext_type);
642 PEM_write_bio(bio_c_out, pem_name, "", ext_buf, 4 + inlen);
643 return 1;
644}
645

--- 1719 unchanged lines hidden ---