asn1_build_known_oid() includes ASN1_OID tag and length
This commit is contained in:
@@ -224,7 +224,7 @@ int asn1_known_oid(chunk_t object)
|
||||
/*
|
||||
* Defined in header.
|
||||
*/
|
||||
chunk_t asn1_get_known_oid(int n)
|
||||
chunk_t asn1_build_known_oid(int n)
|
||||
{
|
||||
chunk_t oid;
|
||||
int i;
|
||||
@@ -235,7 +235,10 @@ chunk_t asn1_get_known_oid(int n)
|
||||
}
|
||||
|
||||
i = oid_names[n].level + 1;
|
||||
oid = chunk_alloc(i);
|
||||
oid = chunk_alloc(2 + i);
|
||||
oid.ptr[0] = ASN1_OID;
|
||||
oid.ptr[1] = i;
|
||||
|
||||
do
|
||||
{
|
||||
if (oid_names[n].level >= i)
|
||||
|
||||
@@ -107,12 +107,12 @@ chunk_t asn1_algorithmIdentifier(int oid);
|
||||
int asn1_known_oid(chunk_t object);
|
||||
|
||||
/**
|
||||
* Converts an known OID index to ASN.1 OID
|
||||
* Converts a known OID index to an ASN.1 OID
|
||||
*
|
||||
* @param n index into the oid_names[] table
|
||||
* @return allocated OID chunk, chunk_empty if index out of range
|
||||
*/
|
||||
chunk_t asn1_get_known_oid(int n);
|
||||
chunk_t asn1_build_known_oid(int n);
|
||||
|
||||
/**
|
||||
* Returns the length of an ASN.1 object
|
||||
|
||||
Reference in New Issue
Block a user