Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2003 - 2006 Pekka Riikonen
+ Copyright (C) 2003 - 2007 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
}
- /* Short integer is actually big integer, so handle it correctly */
+ /* Short integer is actually big integer in the BER data, so handle
+ it correctly */
if (type == SILC_ASN1_TAG_SHORT_INTEGER && type == tag)
tag = SILC_ASN1_TAG_INTEGER;
/* Set two OID values */
memset(&tmpb, 0, sizeof(tmpb));
memset(tmpstr, 0, sizeof(tmpstr));
- snprintf(tmpstr, sizeof(tmpstr) - 1, "%lu.%lu",
+ silc_snprintf(tmpstr, sizeof(tmpstr) - 1, "%lu.%lu",
(unsigned long)(rdata[0] & 0xff) / 40,
(unsigned long)(rdata[0] & 0xff) % 40);
silc_buffer_sstrformat(asn1->stack1, &tmpb, tmpstr, SILC_STR_END);
oid |= rdata[i];
memset(tmpstr, 0, sizeof(tmpstr));
- snprintf(tmpstr, sizeof(tmpstr) - 1, ".%lu", (unsigned long)oid);
+ silc_snprintf(tmpstr, sizeof(tmpstr) - 1, ".%lu", (unsigned long)oid);
silc_buffer_sstrformat(asn1->stack1, &tmpb, tmpstr, SILC_STR_END);
}
*oidstr = tmpb.head;
case SILC_ASN1_TAG_OCTET_STRING:
{
- /* Octet string. We take it as 8-bit ASCII */
+ /* Octet string. Take data as is. */
SILC_ASN1_VAD_UCHAR(asn1, opts, unsigned char, s, s_len);
- SILC_ASN1_DECODE_STRING(SILC_STRING_ASCII, s, s_len);
+ *s = silc_smemdup(stack1, rdata, rdata_len);
+ *s_len = rdata_len;
break;
}
SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
if (!type) {
va_end(asn1->ap);
- asn1->ap = NULL;
return FALSE;
}
}
va_end(asn1->ap);
- asn1->ap = NULL;
return ret;
}