lib: Use asn1_current_ofs()
authorVolker Lendecke <vl@samba.org>
Tue, 5 Jan 2016 09:55:44 +0000 (10:55 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 5 Jan 2016 23:54:18 +0000 (00:54 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/auth/spnego_parse.c
source3/libsmb/clispnego.c
source4/auth/gensec/gensec_krb5.c

index b5e4b1c2a066c0589b7e754bab6b9a01c69392e0..1b294df80a624000821ff6285282fb6fa9f00076 100644 (file)
@@ -324,7 +324,9 @@ ssize_t spnego_read_data(TALLOC_CTX *mem_ctx, DATA_BLOB data, struct spnego_data
                }
        }
 
-       if (!asn1_has_error(asn1)) ret = asn1->ofs;
+       if (!asn1_has_error(asn1)) {
+               ret = asn1_current_ofs(asn1);
+       }
 
   err:
 
@@ -361,7 +363,7 @@ ssize_t spnego_write_data(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, struct spnego_da
                goto err;
        }
 
-       ret = asn1->ofs;
+       ret = asn1_current_ofs(asn1);
 
   err:
 
index 6b33d61891246b84de096ba0f6f7553b7685fc25..5cf476bda8a4065cda3bb3cd2aa2b3438e9e25e0 100644 (file)
@@ -86,7 +86,8 @@ DATA_BLOB spnego_gen_negTokenInit(TALLOC_CTX *ctx,
   err:
 
        if (asn1_has_error(data)) {
-               DEBUG(1,("Failed to build negTokenInit at offset %d\n", (int)data->ofs));
+               DEBUG(1, ("Failed to build negTokenInit at offset %d\n",
+                         (int)asn1_current_ofs(data)));
        }
 
        asn1_free(data);
@@ -259,7 +260,8 @@ DATA_BLOB spnego_gen_krb5_wrap(TALLOC_CTX *ctx, const DATA_BLOB ticket, const ui
   err:
 
        if (asn1_has_error(data)) {
-               DEBUG(1,("Failed to build krb5 wrapper at offset %d\n", (int)data->ofs));
+               DEBUG(1, ("Failed to build krb5 wrapper at offset %d\n",
+                         (int)asn1_current_ofs(data)));
        }
 
        asn1_free(data);
@@ -463,7 +465,8 @@ bool spnego_parse_auth_response(TALLOC_CTX *ctx,
   err:
 
        if (asn1_has_error(data)) {
-               DEBUG(3,("spnego_parse_auth_response failed at %d\n", (int)data->ofs));
+               DEBUG(3, ("spnego_parse_auth_response failed at %d\n",
+                         (int)asn1_current_ofs(data)));
                asn1_free(data);
                data_blob_free(auth);
                return false;
index 94506c87f67d7138e76f2622a7aed3d5d1508c0c..2af6b145f6c91f870e8529388748c928a6834373 100644 (file)
@@ -431,7 +431,8 @@ static DATA_BLOB gensec_gssapi_gen_krb5_wrap(TALLOC_CTX *mem_ctx, const DATA_BLO
 
   err:
 
-       DEBUG(1,("Failed to build krb5 wrapper at offset %d\n", (int)data->ofs));
+       DEBUG(1, ("Failed to build krb5 wrapper at offset %d\n",
+                 (int)asn1_current_ofs(data)));
        asn1_free(data);
        return ret;
 }