*(p--) = ((*(n--)) ^ 0xff) + 1;
i--;
/* Complement any octets left */
- for(; i > 0; i--)
+ for (; i > 0; i--)
*(p--) = *(n--) ^ 0xff;
}
} else {
*(to--) = (*(p--) ^ 0xff) + 1;
i--;
- for(; i > 0; i--)
+ for (; i > 0; i--)
*(to--) = *(p--) ^ 0xff;
}
} else {
int
ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
- int inform, unsigned long mask,
- long minsize, long maxsize)
+ int inform, unsigned long mask, long minsize, long maxsize)
{
int str_type;
int ret;
/* First do a string check and work out the number of characters */
switch (inform) {
-
case MBSTRING_BMP:
if (len & 1) {
ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,
{
unsigned long value;
int ret;
+
while (len) {
if (inform == MBSTRING_ASC) {
value = *p++;
len -= 4;
} else {
ret = UTF8_getc(p, len, &value);
- if (ret < 0) return -1;
- len -= ret;
+ if (ret < 0)
+ return -1;
+ len -= ret;
p += ret;
}
if (rfunc) {
in_utf8(unsigned long value, void *arg)
{
int *nchar;
+
nchar = arg;
(*nchar)++;
return 1;
out_utf8(unsigned long value, void *arg)
{
int *outlen;
+
outlen = arg;
*outlen += UTF8_putc(NULL, -1, value);
return 1;
{
int ch;
- if (value > 0x7f) return 0;
- ch = (int)value;
+ if (value > 0x7f)
+ return 0;
+ ch = (int)value;
+
/* Note: we can't use 'isalnum' because certain accented
* characters may count as alphanumeric in some environments.
*/
return objsize;
p = *pp;
- ASN1_put_object(&p, 0,a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
+ ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
memcpy(p, a->data, a->length);
p += a->length;
*(p--) = ((*(n--)) ^ 0xff) + 1;
i--;
/* Complement any octets left */
- for(; i > 0; i--)
+ for (; i > 0; i--)
*(p--) = *(n--) ^ 0xff;
}
} else {
*(to--) = (*(p--) ^ 0xff) + 1;
i--;
- for(; i > 0; i--)
+ for (; i > 0; i--)
*(to--) = *(p--) ^ 0xff;
}
} else {
int
ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
- int inform, unsigned long mask,
- long minsize, long maxsize)
+ int inform, unsigned long mask, long minsize, long maxsize)
{
int str_type;
int ret;
/* First do a string check and work out the number of characters */
switch (inform) {
-
case MBSTRING_BMP:
if (len & 1) {
ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,
{
unsigned long value;
int ret;
+
while (len) {
if (inform == MBSTRING_ASC) {
value = *p++;
len -= 4;
} else {
ret = UTF8_getc(p, len, &value);
- if (ret < 0) return -1;
- len -= ret;
+ if (ret < 0)
+ return -1;
+ len -= ret;
p += ret;
}
if (rfunc) {
in_utf8(unsigned long value, void *arg)
{
int *nchar;
+
nchar = arg;
(*nchar)++;
return 1;
out_utf8(unsigned long value, void *arg)
{
int *outlen;
+
outlen = arg;
*outlen += UTF8_putc(NULL, -1, value);
return 1;
{
int ch;
- if (value > 0x7f) return 0;
- ch = (int)value;
+ if (value > 0x7f)
+ return 0;
+ ch = (int)value;
+
/* Note: we can't use 'isalnum' because certain accented
* characters may count as alphanumeric in some environments.
*/
return objsize;
p = *pp;
- ASN1_put_object(&p, 0,a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
+ ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
memcpy(p, a->data, a->length);
p += a->length;