summaryrefslogtreecommitdiff
path: root/lib/util/asn1.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-12-15 17:02:49 +0100
committerAndrew Bartlett <abartlet@samba.org>2010-12-21 15:10:37 +1100
commit3b591caed00790c5d21b8774c7af87357c329d1c (patch)
treeb44294e3a1e20ea72d188abf5725f38a6de591dd /lib/util/asn1.c
parent32bae1051272e805e290e49dffb25e4a635ffdfb (diff)
downloadsamba-3b591caed00790c5d21b8774c7af87357c329d1c.tar.gz
samba-3b591caed00790c5d21b8774c7af87357c329d1c.tar.bz2
samba-3b591caed00790c5d21b8774c7af87357c329d1c.zip
lib/util/asn1.c - remove the "const" specifier from OID
There is no reason to have it "const" since it's an allocated thing.
Diffstat (limited to 'lib/util/asn1.c')
-rw-r--r--lib/util/asn1.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/util/asn1.c b/lib/util/asn1.c
index 21d4bd4308..f4a6bc5933 100644
--- a/lib/util/asn1.c
+++ b/lib/util/asn1.c
@@ -660,7 +660,7 @@ int asn1_tag_remaining(struct asn1_data *data)
* till buffer ends or not valid sub-identifier is found.
*/
static bool _ber_read_OID_String_impl(TALLOC_CTX *mem_ctx, DATA_BLOB blob,
- const char **OID, size_t *bytes_eaten)
+ char **OID, size_t *bytes_eaten)
{
int i;
uint8_t *b;
@@ -699,7 +699,7 @@ nomem:
}
/* read an object ID from a data blob */
-bool ber_read_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB blob, const char **OID)
+bool ber_read_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB blob, char **OID)
{
size_t bytes_eaten;
@@ -715,14 +715,15 @@ bool ber_read_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB blob, const char **OID)
* 1:2.5.6:0x81
* 1:2.5.6:0x8182
*/
-bool ber_read_partial_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB blob, const char **partial_oid)
+bool ber_read_partial_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB blob,
+ char **partial_oid)
{
size_t bytes_left;
size_t bytes_eaten;
char *identifier = NULL;
char *tmp_oid = NULL;
- if (!_ber_read_OID_String_impl(mem_ctx, blob, (const char **)&tmp_oid, &bytes_eaten))
+ if (!_ber_read_OID_String_impl(mem_ctx, blob, &tmp_oid, &bytes_eaten))
return false;
if (bytes_eaten < blob.length) {
@@ -746,7 +747,7 @@ nomem:
}
/* read an object ID from a ASN1 buffer */
-bool asn1_read_OID(struct asn1_data *data, TALLOC_CTX *mem_ctx, const char **OID)
+bool asn1_read_OID(struct asn1_data *data, TALLOC_CTX *mem_ctx, char **OID)
{
DATA_BLOB blob;
int len;
@@ -785,16 +786,16 @@ bool asn1_read_OID(struct asn1_data *data, TALLOC_CTX *mem_ctx, const char **OID
/* check that the next object ID is correct */
bool asn1_check_OID(struct asn1_data *data, const char *OID)
{
- const char *id;
+ char *id;
if (!asn1_read_OID(data, data, &id)) return false;
if (strcmp(id, OID) != 0) {
- talloc_free(discard_const(id));
+ talloc_free(id);
data->has_error = true;
return false;
}
- talloc_free(discard_const(id));
+ talloc_free(id);
return true;
}