ssl_asn1.c (68651) | ssl_asn1.c (100936) |
---|---|
1/* ssl/ssl_asn1.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 * --- 48 unchanged lines hidden (view full) --- 57 */ 58 59#include <stdio.h> 60#include <stdlib.h> 61#include <openssl/asn1_mac.h> 62#include <openssl/objects.h> 63#include <openssl/x509.h> 64#include "ssl_locl.h" | 1/* ssl/ssl_asn1.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 * --- 48 unchanged lines hidden (view full) --- 57 */ 58 59#include <stdio.h> 60#include <stdlib.h> 61#include <openssl/asn1_mac.h> 62#include <openssl/objects.h> 63#include <openssl/x509.h> 64#include "ssl_locl.h" |
65#include "cryptlib.h" |
|
65 66typedef struct ssl_session_asn1_st 67 { 68 ASN1_INTEGER version; 69 ASN1_INTEGER ssl_version; 70 ASN1_OCTET_STRING cipher; 71 ASN1_OCTET_STRING master_key; 72 ASN1_OCTET_STRING session_id; --- 197 unchanged lines hidden (view full) --- 270 i=SSL3_MAX_SSL_SESSION_ID_LENGTH; 271 else /* if (ssl_version == SSL2_VERSION) */ 272 i=SSL2_MAX_SSL_SESSION_ID_LENGTH; 273 274 if (os.length > i) 275 os.length=i; 276 277 ret->session_id_length=os.length; | 66 67typedef struct ssl_session_asn1_st 68 { 69 ASN1_INTEGER version; 70 ASN1_INTEGER ssl_version; 71 ASN1_OCTET_STRING cipher; 72 ASN1_OCTET_STRING master_key; 73 ASN1_OCTET_STRING session_id; --- 197 unchanged lines hidden (view full) --- 271 i=SSL3_MAX_SSL_SESSION_ID_LENGTH; 272 else /* if (ssl_version == SSL2_VERSION) */ 273 i=SSL2_MAX_SSL_SESSION_ID_LENGTH; 274 275 if (os.length > i) 276 os.length=i; 277 278 ret->session_id_length=os.length; |
279 die(os.length <= sizeof ret->session_id); |
|
278 memcpy(ret->session_id,os.data,os.length); 279 280 M_ASN1_D2I_get(osp,d2i_ASN1_OCTET_STRING); 281 if (ret->master_key_length > SSL_MAX_MASTER_KEY_LENGTH) 282 ret->master_key_length=SSL_MAX_MASTER_KEY_LENGTH; 283 else 284 ret->master_key_length=os.length; 285 memcpy(ret->master_key,os.data,ret->master_key_length); --- 64 unchanged lines hidden --- | 280 memcpy(ret->session_id,os.data,os.length); 281 282 M_ASN1_D2I_get(osp,d2i_ASN1_OCTET_STRING); 283 if (ret->master_key_length > SSL_MAX_MASTER_KEY_LENGTH) 284 ret->master_key_length=SSL_MAX_MASTER_KEY_LENGTH; 285 else 286 ret->master_key_length=os.length; 287 memcpy(ret->master_key,os.data,ret->master_key_length); --- 64 unchanged lines hidden --- |