a_strex.c (160814) | a_strex.c (167612) |
---|---|
1/* a_strex.c */ 2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL 3 * project 2000. 4 */ 5/* ==================================================================== 6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 156 unchanged lines hidden (view full) --- 165{ 166 int i, outlen, len; 167 unsigned char orflags, *p, *q; 168 unsigned long c; 169 p = buf; 170 q = buf + buflen; 171 outlen = 0; 172 while(p != q) { | 1/* a_strex.c */ 2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL 3 * project 2000. 4 */ 5/* ==================================================================== 6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 156 unchanged lines hidden (view full) --- 165{ 166 int i, outlen, len; 167 unsigned char orflags, *p, *q; 168 unsigned long c; 169 p = buf; 170 q = buf + buflen; 171 outlen = 0; 172 while(p != q) { |
173 if(p == buf) orflags = CHARTYPE_FIRST_ESC_2253; | 173 if(p == buf && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_FIRST_ESC_2253; |
174 else orflags = 0; 175 switch(type & BUF_TYPE_WIDTH_MASK) { 176 case 4: 177 c = ((unsigned long)*p++) << 24; 178 c |= ((unsigned long)*p++) << 16; 179 c |= ((unsigned long)*p++) << 8; 180 c |= *p++; 181 break; --- 10 unchanged lines hidden (view full) --- 192 case 0: 193 i = UTF8_getc(p, buflen, &c); 194 if(i < 0) return -1; /* Invalid UTF8String */ 195 p += i; 196 break; 197 default: 198 return -1; /* invalid width */ 199 } | 174 else orflags = 0; 175 switch(type & BUF_TYPE_WIDTH_MASK) { 176 case 4: 177 c = ((unsigned long)*p++) << 24; 178 c |= ((unsigned long)*p++) << 16; 179 c |= ((unsigned long)*p++) << 8; 180 c |= *p++; 181 break; --- 10 unchanged lines hidden (view full) --- 192 case 0: 193 i = UTF8_getc(p, buflen, &c); 194 if(i < 0) return -1; /* Invalid UTF8String */ 195 p += i; 196 break; 197 default: 198 return -1; /* invalid width */ 199 } |
200 if (p == q) orflags = CHARTYPE_LAST_ESC_2253; | 200 if (p == q && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_LAST_ESC_2253; |
201 if(type & BUF_TYPE_CONVUTF8) { 202 unsigned char utfbuf[6]; 203 int utflen; 204 utflen = UTF8_putc(utfbuf, sizeof utfbuf, c); 205 for(i = 0; i < utflen; i++) { 206 /* We don't need to worry about setting orflags correctly 207 * because if utflen==1 its value will be correct anyway 208 * otherwise each character will be > 0x7f and so the --- 359 unchanged lines hidden --- | 201 if(type & BUF_TYPE_CONVUTF8) { 202 unsigned char utfbuf[6]; 203 int utflen; 204 utflen = UTF8_putc(utfbuf, sizeof utfbuf, c); 205 for(i = 0; i < utflen; i++) { 206 /* We don't need to worry about setting orflags correctly 207 * because if utflen==1 its value will be correct anyway 208 * otherwise each character will be > 0x7f and so the --- 359 unchanged lines hidden --- |