summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-02 06:42:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:17 -0500
commit3643fb11092e28a9538ef32cedce8ff21ad86a28 (patch)
tree30e47032832b250d66fb1f601f4d053269be4210 /source4/libcli
parenta1d0b97ed40fe6985bb45b1715309638e7faaffc (diff)
downloadsamba-3643fb11092e28a9538ef32cedce8ff21ad86a28.tar.gz
samba-3643fb11092e28a9538ef32cedce8ff21ad86a28.tar.bz2
samba-3643fb11092e28a9538ef32cedce8ff21ad86a28.zip
r3463: separated out some more headers (asn_1.h, messages.h, dlinklist.h and ioctl.h)
(This used to be commit b97e395c814762024336c1cf4d7c25be8da5813a)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/auth/gensec_krb5.c1
-rw-r--r--source4/libcli/auth/gensec_ntlmssp.c1
-rw-r--r--source4/libcli/auth/gssapi_parse.c5
-rw-r--r--source4/libcli/auth/kerberos_verify.c3
-rw-r--r--source4/libcli/auth/spnego.c1
-rw-r--r--source4/libcli/auth/spnego_parse.c13
-rw-r--r--source4/libcli/ldap/ldap.c20
-rw-r--r--source4/libcli/raw/clisession.c1
-rw-r--r--source4/libcli/raw/clitransport.c1
-rw-r--r--source4/libcli/raw/rawrequest.c1
-rw-r--r--source4/libcli/util/asn1.c77
11 files changed, 68 insertions, 56 deletions
diff --git a/source4/libcli/auth/gensec_krb5.c b/source4/libcli/auth/gensec_krb5.c
index 0e374e8219..c3dd84135a 100644
--- a/source4/libcli/auth/gensec_krb5.c
+++ b/source4/libcli/auth/gensec_krb5.c
@@ -28,6 +28,7 @@
#include "libcli/auth/kerberos.h"
#include "librpc/gen_ndr/ndr_krb5pac.h"
#include "auth/auth.h"
+#include "asn_1.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
diff --git a/source4/libcli/auth/gensec_ntlmssp.c b/source4/libcli/auth/gensec_ntlmssp.c
index 4b1d5f3b02..8ab90ebcfb 100644
--- a/source4/libcli/auth/gensec_ntlmssp.c
+++ b/source4/libcli/auth/gensec_ntlmssp.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "auth/auth.h"
+#include "asn_1.h"
struct gensec_ntlmssp_state {
struct auth_context *auth_context;
diff --git a/source4/libcli/auth/gssapi_parse.c b/source4/libcli/auth/gssapi_parse.c
index 4a80e1d799..529799955d 100644
--- a/source4/libcli/auth/gssapi_parse.c
+++ b/source4/libcli/auth/gssapi_parse.c
@@ -23,13 +23,14 @@
*/
#include "includes.h"
+#include "asn_1.h"
/*
generate a krb5 GSS-API wrapper packet given a ticket
*/
DATA_BLOB gensec_gssapi_gen_krb5_wrap(TALLOC_CTX *mem_ctx, const DATA_BLOB *ticket, const uint8 tok_id[2])
{
- ASN1_DATA data;
+ struct asn1_data data;
DATA_BLOB ret;
ZERO_STRUCT(data);
@@ -58,7 +59,7 @@ DATA_BLOB gensec_gssapi_gen_krb5_wrap(TALLOC_CTX *mem_ctx, const DATA_BLOB *tick
BOOL gensec_gssapi_parse_krb5_wrap(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, DATA_BLOB *ticket, uint8 tok_id[2])
{
BOOL ret;
- ASN1_DATA data;
+ struct asn1_data data;
int data_remaining;
asn1_load(&data, *blob);
diff --git a/source4/libcli/auth/kerberos_verify.c b/source4/libcli/auth/kerberos_verify.c
index 8e598e2a66..6d87cf8d8b 100644
--- a/source4/libcli/auth/kerberos_verify.c
+++ b/source4/libcli/auth/kerberos_verify.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "system/kerberos.h"
#include "libcli/auth/kerberos.h"
+#include "asn_1.h"
#ifdef HAVE_KRB5
@@ -32,7 +33,7 @@ static DATA_BLOB unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data)
{
DATA_BLOB out;
DATA_BLOB pac_contents = data_blob(NULL, 0);
- ASN1_DATA data;
+ struct asn1_data data;
int data_type;
if (!auth_data->length) {
return data_blob(NULL, 0);
diff --git a/source4/libcli/auth/spnego.c b/source4/libcli/auth/spnego.c
index ef9763cad7..ab3aff32bb 100644
--- a/source4/libcli/auth/spnego.c
+++ b/source4/libcli/auth/spnego.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "auth/auth.h"
+#include "asn_1.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
diff --git a/source4/libcli/auth/spnego_parse.c b/source4/libcli/auth/spnego_parse.c
index d6eacc4a6a..f9385ed96e 100644
--- a/source4/libcli/auth/spnego_parse.c
+++ b/source4/libcli/auth/spnego_parse.c
@@ -23,11 +23,12 @@
#include "includes.h"
#include "auth/auth.h"
+#include "asn_1.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
-static BOOL read_negTokenInit(ASN1_DATA *asn1, struct spnego_negTokenInit *token)
+static BOOL read_negTokenInit(struct asn1_data *asn1, struct spnego_negTokenInit *token)
{
ZERO_STRUCTP(token);
@@ -117,7 +118,7 @@ static BOOL read_negTokenInit(ASN1_DATA *asn1, struct spnego_negTokenInit *token
return !asn1->has_error;
}
-static BOOL write_negTokenInit(ASN1_DATA *asn1, struct spnego_negTokenInit *token)
+static BOOL write_negTokenInit(struct asn1_data *asn1, struct spnego_negTokenInit *token)
{
asn1_push_tag(asn1, ASN1_CONTEXT(0));
asn1_push_tag(asn1, ASN1_SEQUENCE(0));
@@ -180,7 +181,7 @@ static BOOL write_negTokenInit(ASN1_DATA *asn1, struct spnego_negTokenInit *toke
return !asn1->has_error;
}
-static BOOL read_negTokenTarg(ASN1_DATA *asn1, struct spnego_negTokenTarg *token)
+static BOOL read_negTokenTarg(struct asn1_data *asn1, struct spnego_negTokenTarg *token)
{
ZERO_STRUCTP(token);
@@ -229,7 +230,7 @@ static BOOL read_negTokenTarg(ASN1_DATA *asn1, struct spnego_negTokenTarg *token
return !asn1->has_error;
}
-static BOOL write_negTokenTarg(ASN1_DATA *asn1, struct spnego_negTokenTarg *token)
+static BOOL write_negTokenTarg(struct asn1_data *asn1, struct spnego_negTokenTarg *token)
{
asn1_push_tag(asn1, ASN1_CONTEXT(1));
asn1_push_tag(asn1, ASN1_SEQUENCE(0));
@@ -268,7 +269,7 @@ static BOOL write_negTokenTarg(ASN1_DATA *asn1, struct spnego_negTokenTarg *toke
ssize_t spnego_read_data(DATA_BLOB data, struct spnego_data *token)
{
- ASN1_DATA asn1;
+ struct asn1_data asn1;
ssize_t ret = -1;
uint8_t context;
@@ -312,7 +313,7 @@ ssize_t spnego_read_data(DATA_BLOB data, struct spnego_data *token)
ssize_t spnego_write_data(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, struct spnego_data *spnego)
{
- ASN1_DATA asn1;
+ struct asn1_data asn1;
ssize_t ret = -1;
ZERO_STRUCT(asn1);
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c
index 9b481313e3..5224373afc 100644
--- a/source4/libcli/ldap/ldap.c
+++ b/source4/libcli/ldap/ldap.c
@@ -27,6 +27,8 @@
#include "system/network.h"
#include "system/iconv.h"
#include "auth/auth.h"
+#include "asn_1.h"
+#include "dlinklist.h"
/****************************************************************************
*
@@ -303,7 +305,7 @@ static struct ldap_parse_tree *ldap_parse_tree(TALLOC_CTX *mem_ctx, const char *
return ldap_parse_simple(mem_ctx, s);
}
-static BOOL ldap_push_filter(ASN1_DATA *data, struct ldap_parse_tree *tree)
+static BOOL ldap_push_filter(struct asn1_data *data, struct ldap_parse_tree *tree)
{
switch (tree->operation) {
case LDAP_OP_SIMPLE: {
@@ -354,7 +356,7 @@ static BOOL ldap_push_filter(ASN1_DATA *data, struct ldap_parse_tree *tree)
return !data->has_error;
}
-static void ldap_encode_response(ASN1_DATA *data, struct ldap_Result *result)
+static void ldap_encode_response(struct asn1_data *data, struct ldap_Result *result)
{
asn1_write_enumerated(data, result->resultcode);
asn1_write_OctetString(data, result->dn,
@@ -369,7 +371,7 @@ static void ldap_encode_response(ASN1_DATA *data, struct ldap_Result *result)
BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result)
{
- ASN1_DATA data;
+ struct asn1_data data;
int i, j;
ZERO_STRUCT(data);
@@ -663,7 +665,7 @@ static const char *blob2string_talloc(TALLOC_CTX *mem_ctx,
}
static BOOL asn1_read_OctetString_talloc(TALLOC_CTX *mem_ctx,
- ASN1_DATA *data,
+ struct asn1_data *data,
const char **result)
{
DATA_BLOB string;
@@ -675,7 +677,7 @@ static BOOL asn1_read_OctetString_talloc(TALLOC_CTX *mem_ctx,
}
static void ldap_decode_response(TALLOC_CTX *mem_ctx,
- ASN1_DATA *data,
+ struct asn1_data *data,
struct ldap_Result *result)
{
asn1_read_enumerated(data, &result->resultcode);
@@ -690,7 +692,7 @@ static void ldap_decode_response(TALLOC_CTX *mem_ctx,
}
}
-static BOOL ldap_decode_filter(TALLOC_CTX *mem_ctx, ASN1_DATA *data,
+static BOOL ldap_decode_filter(TALLOC_CTX *mem_ctx, struct asn1_data *data,
char **filter)
{
uint8 filter_tag, tag_desc;
@@ -795,7 +797,7 @@ static BOOL ldap_decode_filter(TALLOC_CTX *mem_ctx, ASN1_DATA *data,
return True;
}
-static void ldap_decode_attrib(TALLOC_CTX *mem_ctx, ASN1_DATA *data,
+static void ldap_decode_attrib(TALLOC_CTX *mem_ctx, struct asn1_data *data,
struct ldap_attribute *attrib)
{
asn1_start_tag(data, ASN1_SEQUENCE(0));
@@ -815,7 +817,7 @@ static void ldap_decode_attrib(TALLOC_CTX *mem_ctx, ASN1_DATA *data,
}
-static void ldap_decode_attribs(TALLOC_CTX *mem_ctx, ASN1_DATA *data,
+static void ldap_decode_attribs(TALLOC_CTX *mem_ctx, struct asn1_data *data,
struct ldap_attribute **attributes,
int *num_attributes)
{
@@ -830,7 +832,7 @@ static void ldap_decode_attribs(TALLOC_CTX *mem_ctx, ASN1_DATA *data,
asn1_end_tag(data);
}
-BOOL ldap_decode(ASN1_DATA *data, struct ldap_message *msg)
+BOOL ldap_decode(struct asn1_data *data, struct ldap_message *msg)
{
uint8 tag;
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c
index 23e1d8507e..b7802d8065 100644
--- a/source4/libcli/raw/clisession.c
+++ b/source4/libcli/raw/clisession.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "auth/auth.h"
+#include "asn_1.h"
#define SETUP_REQUEST_SESSION(cmd, wct, buflen) do { \
req = smbcli_request_setup_session(session, cmd, wct, buflen); \
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index e70ee915c6..c5e3d39545 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
+#include "dlinklist.h"
static void smbcli_transport_process_recv(struct smbcli_transport *transport);
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index 5cf1621d2d..0526fec74b 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "dlinklist.h"
/* we over allocate the data buffer to prevent too many realloc calls */
#define REQ_OVER_ALLOCATION 256
diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c
index e03b1d5f39..15858f4f75 100644
--- a/source4/libcli/util/asn1.c
+++ b/source4/libcli/util/asn1.c
@@ -19,15 +19,16 @@
*/
#include "includes.h"
+#include "asn_1.h"
/* free an asn1 structure */
-void asn1_free(ASN1_DATA *data)
+void asn1_free(struct asn1_data *data)
{
talloc_free(data->data);
}
/* write to the ASN1 buffer, advancing the buffer pointer */
-BOOL asn1_write(ASN1_DATA *data, const void *p, int len)
+BOOL asn1_write(struct asn1_data *data, const void *p, int len)
{
if (data->has_error) return False;
if (data->length < data->ofs+len) {
@@ -47,13 +48,13 @@ BOOL asn1_write(ASN1_DATA *data, const void *p, int len)
}
/* useful fn for writing a uint8_t */
-BOOL asn1_write_uint8(ASN1_DATA *data, uint8_t v)
+BOOL asn1_write_uint8(struct asn1_data *data, uint8_t v)
{
return asn1_write(data, &v, 1);
}
/* push a tag onto the asn1 data buffer. Used for nested structures */
-BOOL asn1_push_tag(ASN1_DATA *data, uint8_t tag)
+BOOL asn1_push_tag(struct asn1_data *data, uint8_t tag)
{
struct nesting *nesting;
@@ -71,7 +72,7 @@ BOOL asn1_push_tag(ASN1_DATA *data, uint8_t tag)
}
/* pop a tag */
-BOOL asn1_pop_tag(ASN1_DATA *data)
+BOOL asn1_pop_tag(struct asn1_data *data)
{
struct nesting *nesting;
size_t len;
@@ -110,7 +111,7 @@ BOOL asn1_pop_tag(ASN1_DATA *data)
/* "i" is the one's complement representation, as is the normal result of an
* implicit signed->unsigned conversion */
-static BOOL push_int_bigendian(ASN1_DATA *data, unsigned int i, BOOL negative)
+static BOOL push_int_bigendian(struct asn1_data *data, unsigned int i, BOOL negative)
{
uint8_t lowest = i & 0xFF;
@@ -153,7 +154,7 @@ static BOOL push_int_bigendian(ASN1_DATA *data, unsigned int i, BOOL negative)
/* write an Integer without the tag framing. Needed for example for the LDAP
* Abandon Operation */
-BOOL asn1_write_implicit_Integer(ASN1_DATA *data, int i)
+BOOL asn1_write_implicit_Integer(struct asn1_data *data, int i)
{
if (i == -1) {
/* -1 is special as it consists of all-0xff bytes. In
@@ -168,7 +169,7 @@ BOOL asn1_write_implicit_Integer(ASN1_DATA *data, int i)
/* write an integer */
-BOOL asn1_write_Integer(ASN1_DATA *data, int i)
+BOOL asn1_write_Integer(struct asn1_data *data, int i)
{
if (!asn1_push_tag(data, ASN1_INTEGER)) return False;
if (!asn1_write_implicit_Integer(data, i)) return False;
@@ -176,7 +177,7 @@ BOOL asn1_write_Integer(ASN1_DATA *data, int i)
}
/* write an object ID to a ASN1 buffer */
-BOOL asn1_write_OID(ASN1_DATA *data, const char *OID)
+BOOL asn1_write_OID(struct asn1_data *data, const char *OID)
{
uint_t v, v2;
const char *p = (const char *)OID;
@@ -205,7 +206,7 @@ BOOL asn1_write_OID(ASN1_DATA *data, const char *OID)
}
/* write an octet string */
-BOOL asn1_write_OctetString(ASN1_DATA *data, const void *p, size_t length)
+BOOL asn1_write_OctetString(struct asn1_data *data, const void *p, size_t length)
{
asn1_push_tag(data, ASN1_OCTET_STRING);
asn1_write(data, p, length);
@@ -214,7 +215,7 @@ BOOL asn1_write_OctetString(ASN1_DATA *data, const void *p, size_t length)
}
/* write a general string */
-BOOL asn1_write_GeneralString(ASN1_DATA *data, const char *s)
+BOOL asn1_write_GeneralString(struct asn1_data *data, const char *s)
{
asn1_push_tag(data, ASN1_GENERAL_STRING);
asn1_write(data, s, strlen(s));
@@ -222,7 +223,7 @@ BOOL asn1_write_GeneralString(ASN1_DATA *data, const char *s)
return !data->has_error;
}
-BOOL asn1_write_ContextSimple(ASN1_DATA *data, uint8_t num, DATA_BLOB *blob)
+BOOL asn1_write_ContextSimple(struct asn1_data *data, uint8_t num, DATA_BLOB *blob)
{
asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(num));
asn1_write(data, blob->data, blob->length);
@@ -231,7 +232,7 @@ BOOL asn1_write_ContextSimple(ASN1_DATA *data, uint8_t num, DATA_BLOB *blob)
}
/* write a BOOLEAN */
-BOOL asn1_write_BOOLEAN(ASN1_DATA *data, BOOL v)
+BOOL asn1_write_BOOLEAN(struct asn1_data *data, BOOL v)
{
asn1_push_tag(data, ASN1_BOOLEAN);
asn1_write_uint8(data, v ? 0xFF : 0);
@@ -239,7 +240,7 @@ BOOL asn1_write_BOOLEAN(ASN1_DATA *data, BOOL v)
return !data->has_error;
}
-BOOL asn1_read_BOOLEAN(ASN1_DATA *data, BOOL *v)
+BOOL asn1_read_BOOLEAN(struct asn1_data *data, BOOL *v)
{
uint8_t tmp = 0;
asn1_start_tag(data, ASN1_BOOLEAN);
@@ -254,7 +255,7 @@ BOOL asn1_read_BOOLEAN(ASN1_DATA *data, BOOL *v)
}
/* check a BOOLEAN */
-BOOL asn1_check_BOOLEAN(ASN1_DATA *data, BOOL v)
+BOOL asn1_check_BOOLEAN(struct asn1_data *data, BOOL v)
{
uint8_t b = 0;
@@ -272,8 +273,8 @@ BOOL asn1_check_BOOLEAN(ASN1_DATA *data, BOOL v)
}
-/* load a ASN1_DATA structure with a lump of data, ready to be parsed */
-BOOL asn1_load(ASN1_DATA *data, DATA_BLOB blob)
+/* load a struct asn1_data structure with a lump of data, ready to be parsed */
+BOOL asn1_load(struct asn1_data *data, DATA_BLOB blob)
{
ZERO_STRUCTP(data);
data->data = talloc_memdup(NULL, blob.data, blob.length);
@@ -286,7 +287,7 @@ BOOL asn1_load(ASN1_DATA *data, DATA_BLOB blob)
}
/* Peek into an ASN1 buffer, not advancing the pointer */
-BOOL asn1_peek(ASN1_DATA *data, void *p, int len)
+BOOL asn1_peek(struct asn1_data *data, void *p, int len)
{
if (len < 0 || data->ofs + len < data->ofs || data->ofs + len < len)
return False;
@@ -299,7 +300,7 @@ BOOL asn1_peek(ASN1_DATA *data, void *p, int len)
}
/* read from a ASN1 buffer, advancing the buffer pointer */
-BOOL asn1_read(ASN1_DATA *data, void *p, int len)
+BOOL asn1_read(struct asn1_data *data, void *p, int len)
{
if (!asn1_peek(data, p, len)) {
data->has_error = True;
@@ -311,17 +312,17 @@ BOOL asn1_read(ASN1_DATA *data, void *p, int len)
}
/* read a uint8_t from a ASN1 buffer */
-BOOL asn1_read_uint8(ASN1_DATA *data, uint8_t *v)
+BOOL asn1_read_uint8(struct asn1_data *data, uint8_t *v)
{
return asn1_read(data, v, 1);
}
-BOOL asn1_peek_uint8(ASN1_DATA *data, uint8_t *v)
+BOOL asn1_peek_uint8(struct asn1_data *data, uint8_t *v)
{
return asn1_peek(data, v, 1);
}
-BOOL asn1_peek_tag(ASN1_DATA *data, uint8_t tag)
+BOOL asn1_peek_tag(struct asn1_data *data, uint8_t tag)
{
uint8_t b;
@@ -336,7 +337,7 @@ BOOL asn1_peek_tag(ASN1_DATA *data, uint8_t tag)
}
/* start reading a nested asn1 structure */
-BOOL asn1_start_tag(ASN1_DATA *data, uint8_t tag)
+BOOL asn1_start_tag(struct asn1_data *data, uint8_t tag)
{
uint8_t b;
struct nesting *nesting;
@@ -378,7 +379,7 @@ BOOL asn1_start_tag(ASN1_DATA *data, uint8_t tag)
return !data->has_error;
}
-static BOOL read_one_uint8(int sock, uint8_t *result, ASN1_DATA *data,
+static BOOL read_one_uint8(int sock, uint8_t *result, struct asn1_data *data,
const struct timeval *endtime)
{
if (read_data_until(sock, result, 1, endtime) != 1)
@@ -388,7 +389,7 @@ static BOOL read_one_uint8(int sock, uint8_t *result, ASN1_DATA *data,
}
/* Read a complete ASN sequence (ie LDAP result) from a socket */
-BOOL asn1_read_sequence_until(int sock, ASN1_DATA *data,
+BOOL asn1_read_sequence_until(int sock, struct asn1_data *data,
const struct timeval *endtime)
{
uint8_t b;
@@ -444,7 +445,7 @@ BOOL asn1_read_sequence_until(int sock, ASN1_DATA *data,
BOOL asn1_object_length(uint8_t *buf, size_t buf_length,
uint8_t tag, size_t *result)
{
- ASN1_DATA data;
+ struct asn1_data data;
/* Fake the asn1_load to avoid the memdup, this is just to be able to
* re-use the length-reading in asn1_start_tag */
@@ -461,7 +462,7 @@ BOOL asn1_object_length(uint8_t *buf, size_t buf_length,
}
/* stop reading a tag */
-BOOL asn1_end_tag(ASN1_DATA *data)
+BOOL asn1_end_tag(struct asn1_data *data)
{
struct nesting *nesting;
@@ -484,7 +485,7 @@ BOOL asn1_end_tag(ASN1_DATA *data)
}
/* work out how many bytes are left in this nested tag */
-int asn1_tag_remaining(ASN1_DATA *data)
+int asn1_tag_remaining(struct asn1_data *data)
{
if (!data->nesting) {
data->has_error = True;
@@ -494,7 +495,7 @@ int asn1_tag_remaining(ASN1_DATA *data)
}
/* read an object ID from a ASN1 buffer */
-BOOL asn1_read_OID(ASN1_DATA *data, const char **OID)
+BOOL asn1_read_OID(struct asn1_data *data, const char **OID)
{
uint8_t b;
char *tmp_oid = NULL;
@@ -523,7 +524,7 @@ BOOL asn1_read_OID(ASN1_DATA *data, const char **OID)
}
/* check that the next object ID is correct */
-BOOL asn1_check_OID(ASN1_DATA *data, const char *OID)
+BOOL asn1_check_OID(struct asn1_data *data, const char *OID)
{
const char *id;
@@ -538,7 +539,7 @@ BOOL asn1_check_OID(ASN1_DATA *data, const char *OID)
}
/* read a GeneralString from a ASN1 buffer */
-BOOL asn1_read_GeneralString(ASN1_DATA *data, char **s)
+BOOL asn1_read_GeneralString(struct asn1_data *data, char **s)
{
int len;
if (!asn1_start_tag(data, ASN1_GENERAL_STRING)) return False;
@@ -559,7 +560,7 @@ BOOL asn1_read_GeneralString(ASN1_DATA *data, char **s)
}
/* read a octet string blob */
-BOOL asn1_read_OctetString(ASN1_DATA *data, DATA_BLOB *blob)
+BOOL asn1_read_OctetString(struct asn1_data *data, DATA_BLOB *blob)
{
int len;
ZERO_STRUCTP(blob);
@@ -581,7 +582,7 @@ BOOL asn1_read_OctetString(ASN1_DATA *data, DATA_BLOB *blob)
return True;
}
-BOOL asn1_read_ContextSimple(ASN1_DATA *data, uint8_t num, DATA_BLOB *blob)
+BOOL asn1_read_ContextSimple(struct asn1_data *data, uint8_t num, DATA_BLOB *blob)
{
int len;
ZERO_STRUCTP(blob);
@@ -598,7 +599,7 @@ BOOL asn1_read_ContextSimple(ASN1_DATA *data, uint8_t num, DATA_BLOB *blob)
}
/* read an interger without tag*/
-BOOL asn1_read_implicit_Integer(ASN1_DATA *data, int *i)
+BOOL asn1_read_implicit_Integer(struct asn1_data *data, int *i)
{
uint8_t b;
*i = 0;
@@ -612,7 +613,7 @@ BOOL asn1_read_implicit_Integer(ASN1_DATA *data, int *i)
}
/* read an interger */
-BOOL asn1_read_Integer(ASN1_DATA *data, int *i)
+BOOL asn1_read_Integer(struct asn1_data *data, int *i)
{
*i = 0;
@@ -623,7 +624,7 @@ BOOL asn1_read_Integer(ASN1_DATA *data, int *i)
}
/* read an interger */
-BOOL asn1_read_enumerated(ASN1_DATA *data, int *v)
+BOOL asn1_read_enumerated(struct asn1_data *data, int *v)
{
*v = 0;
@@ -637,7 +638,7 @@ BOOL asn1_read_enumerated(ASN1_DATA *data, int *v)
}
/* check a enumarted value is correct */
-BOOL asn1_check_enumerated(ASN1_DATA *data, int v)
+BOOL asn1_check_enumerated(struct asn1_data *data, int v)
{
uint8_t b;
if (!asn1_start_tag(data, ASN1_ENUMERATED)) return False;
@@ -651,7 +652,7 @@ BOOL asn1_check_enumerated(ASN1_DATA *data, int v)
}
/* write an enumarted value to the stream */
-BOOL asn1_write_enumerated(ASN1_DATA *data, uint8_t v)
+BOOL asn1_write_enumerated(struct asn1_data *data, uint8_t v)
{
if (!asn1_push_tag(data, ASN1_ENUMERATED)) return False;
asn1_write_uint8(data, v);