summaryrefslogtreecommitdiff
path: root/libcli/auth
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-01-02 20:10:53 +0100
committerJeremy Allison <jra@samba.org>2016-01-06 00:54:18 +0100
commita93946b2fee6d6fedb9830d1dec593fca15fefc8 (patch)
tree587c9a657da3280f68a22a11f603bd0af224ea8e /libcli/auth
parent7b7aa016df35ed7f8388a9df08d66a816adc1bf7 (diff)
downloadsamba-a93946b2fee6d6fedb9830d1dec593fca15fefc8.tar.gz
samba-a93946b2fee6d6fedb9830d1dec593fca15fefc8.tar.bz2
samba-a93946b2fee6d6fedb9830d1dec593fca15fefc8.zip
lib: Use asn1_extract_blob()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli/auth')
-rw-r--r--libcli/auth/spnego_parse.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libcli/auth/spnego_parse.c b/libcli/auth/spnego_parse.c
index 54181893043..b5e4b1c2a06 100644
--- a/libcli/auth/spnego_parse.c
+++ b/libcli/auth/spnego_parse.c
@@ -357,11 +357,12 @@ ssize_t spnego_write_data(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, struct spnego_da
break;
}
- if (!asn1_has_error(asn1)) {
- *blob = data_blob_talloc(mem_ctx, asn1->data, asn1->length);
- ret = asn1->ofs;
+ if (!asn1_extract_blob(asn1, mem_ctx, blob)) {
+ goto err;
}
+ ret = asn1->ofs;
+
err:
asn1_free(asn1);
@@ -427,8 +428,7 @@ bool spnego_write_mech_types(TALLOC_CTX *mem_ctx,
goto err;
}
- *blob = data_blob_talloc(mem_ctx, asn1->data, asn1->length);
- if (blob->length != asn1->length) {
+ if (!asn1_extract_blob(asn1, mem_ctx, blob)) {
goto err;
}