From 41787e147279ff0695e9d759487266a60b80867b Mon Sep 17 00:00:00 2001 From: Rene Mayrhofer Date: Tue, 23 Jun 2009 11:25:24 +0000 Subject: [svn-upgrade] Integrating new upstream version, strongswan (4.3.2) --- src/libstrongswan/asn1/asn1.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/libstrongswan/asn1/asn1.h') diff --git a/src/libstrongswan/asn1/asn1.h b/src/libstrongswan/asn1/asn1.h index 4ea89730c..6a2b594c0 100644 --- a/src/libstrongswan/asn1/asn1.h +++ b/src/libstrongswan/asn1/asn1.h @@ -13,8 +13,6 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. - * - * $Id: asn1.h 5003 2009-03-24 17:43:01Z martin $ */ /** @@ -27,7 +25,8 @@ #include -#include +#include +#include /** * Definition of some primitive ASN1 types @@ -106,6 +105,14 @@ chunk_t asn1_algorithmIdentifier(int oid); */ int asn1_known_oid(chunk_t object); +/** + * 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_build_known_oid(int n); + /** * Returns the length of an ASN.1 object * The blob pointer is advanced past the tag length fields @@ -113,7 +120,7 @@ int asn1_known_oid(chunk_t object); * @param blob pointer to an ASN.1 coded blob * @return length of ASN.1 object */ -u_int asn1_length(chunk_t *blob); +size_t asn1_length(chunk_t *blob); /** * Parses an ASN.1 algorithmIdentifier object @@ -220,6 +227,15 @@ chunk_t asn1_simple_object(asn1_t tag, chunk_t content); */ chunk_t asn1_bitstring(const char *mode, chunk_t content); +/** + * Build an ASN.1 INTEGER object + * + * @param mode 'c' for copy or 'm' for move + * @param content content of the INTEGER + * @return chunk containing the ASN.1 coded INTEGER + */ +chunk_t asn1_integer(const char *mode, chunk_t content); + /** * Build an ASN.1 object from a variable number of individual chunks * -- cgit v1.2.3