a_bitstr.c (325335) | a_bitstr.c (325337) |
---|---|
1/* crypto/asn1/a_bitstr.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 * --- 42 unchanged lines hidden (view full) --- 51 * SUCH DAMAGE. 52 * 53 * The licence and distribution terms for any publically available version or 54 * derivative of this code cannot be changed. i.e. this code cannot simply be 55 * copied and put under another distribution licence 56 * [including the GNU Public Licence.] 57 */ 58 | 1/* crypto/asn1/a_bitstr.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 * --- 42 unchanged lines hidden (view full) --- 51 * SUCH DAMAGE. 52 * 53 * The licence and distribution terms for any publically available version or 54 * derivative of this code cannot be changed. i.e. this code cannot simply be 55 * copied and put under another distribution licence 56 * [including the GNU Public Licence.] 57 */ 58 |
59#include <limits.h> |
|
59#include <stdio.h> 60#include "cryptlib.h" 61#include <openssl/asn1.h> 62 63int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) 64{ 65 return M_ASN1_BIT_STRING_set(x, d, len); 66} --- 64 unchanged lines hidden (view full) --- 131 unsigned char *s; 132 int i; 133 134 if (len < 1) { 135 i = ASN1_R_STRING_TOO_SHORT; 136 goto err; 137 } 138 | 60#include <stdio.h> 61#include "cryptlib.h" 62#include <openssl/asn1.h> 63 64int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) 65{ 66 return M_ASN1_BIT_STRING_set(x, d, len); 67} --- 64 unchanged lines hidden (view full) --- 132 unsigned char *s; 133 int i; 134 135 if (len < 1) { 136 i = ASN1_R_STRING_TOO_SHORT; 137 goto err; 138 } 139 |
140 if (len > INT_MAX) { 141 i = ASN1_R_STRING_TOO_LONG; 142 goto err; 143 } 144 |
|
139 if ((a == NULL) || ((*a) == NULL)) { 140 if ((ret = M_ASN1_BIT_STRING_new()) == NULL) 141 return (NULL); 142 } else 143 ret = (*a); 144 145 p = *pp; 146 i = *(p++); --- 117 unchanged lines hidden --- | 145 if ((a == NULL) || ((*a) == NULL)) { 146 if ((ret = M_ASN1_BIT_STRING_new()) == NULL) 147 return (NULL); 148 } else 149 ret = (*a); 150 151 p = *pp; 152 i = *(p++); --- 117 unchanged lines hidden --- |