Deleted Added
sdiff udiff text old ( 101386 ) new ( 101613 )
full compact
1/* crypto/asn1/asn1_lib.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 *

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

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 <stdio.h>
60#include <limits.h>
61#include "cryptlib.h"
62#include <openssl/asn1.h>
63#include <openssl/asn1_mac.h>
64
65static int asn1_get_length(unsigned char **pp,int *inf,long *rl,int max);
66static void asn1_put_length(unsigned char **pp, int length);
67const char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT;
68

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

137err:
138 ASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_HEADER_TOO_LONG);
139 return(0x80);
140 }
141
142static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
143 {
144 unsigned char *p= *pp;
145 unsigned long ret=0;
146 int i;
147
148 if (max-- < 1) return(0);
149 if (*p == 0x80)
150 {
151 *inf=1;
152 ret=0;
153 p++;

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

166 ret<<=8L;
167 ret|= *(p++);
168 if (max-- == 0) return(0);
169 }
170 }
171 else
172 ret=i;
173 }
174 if (ret > LONG_MAX)
175 return 0;
176 *pp=p;
177 *rl=(long)ret;
178 return(1);
179 }
180
181/* class 0 is constructed
182 * constructed == 2 for indefinite length constructed */
183void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
184 int xclass)
185 {

--- 245 unchanged lines hidden ---