summaryrefslogtreecommitdiff
path: root/source3/libsmb/asn1.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-10-12 04:49:42 +0000
committerAndrew Tridgell <tridge@samba.org>2001-10-12 04:49:42 +0000
commit9f7cb41f11c0d2fc09104f6998f75c59bc363b26 (patch)
treeef023f03e5ea53a178c2d874a682f607e13f6397 /source3/libsmb/asn1.c
parent8632b44f6ba2a1b8698c62778dc6547bed4bae92 (diff)
downloadsamba-9f7cb41f11c0d2fc09104f6998f75c59bc363b26.tar.gz
samba-9f7cb41f11c0d2fc09104f6998f75c59bc363b26.tar.bz2
samba-9f7cb41f11c0d2fc09104f6998f75c59bc363b26.zip
added NTLMSSP authentication to libsmb. It seems to work well so I have enabled it by default if the server supports it. Let me know if this breaks anything. Choose kerberos with the -k flag to smbclient, otherwise it will use SPNEGO/NTLMSSP/NTLM
(This used to be commit 076aa97bee54d182288d9e93ae160ae22a5f7757)
Diffstat (limited to 'source3/libsmb/asn1.c')
-rw-r--r--source3/libsmb/asn1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/libsmb/asn1.c b/source3/libsmb/asn1.c
index 17b1ee1089..6a92a6be00 100644
--- a/source3/libsmb/asn1.c
+++ b/source3/libsmb/asn1.c
@@ -315,3 +315,30 @@ BOOL asn1_read_GeneralString(ASN1_DATA *data, char **s)
asn1_end_tag(data);
return !data->has_error;
}
+
+/* read a octet string blob */
+BOOL asn1_read_octet_string(ASN1_DATA *data, DATA_BLOB *blob)
+{
+ int len;
+ if (!asn1_start_tag(data, ASN1_OCTET_STRING)) return False;
+ len = asn1_tag_remaining(data);
+ blob->data = malloc(len);
+ if (!blob->data) {
+ data->has_error = True;
+ return False;
+ }
+ asn1_read(data, blob->data, len);
+ blob->length = len;
+ asn1_end_tag(data);
+ return !data->has_error;
+}
+
+/* check a enumarted value is correct */
+BOOL asn1_check_enumerated(ASN1_DATA *data, int v)
+{
+ uint8 b;
+ if (!asn1_start_tag(data, ASN1_ENUMERATED)) return False;
+ asn1_read_uint8(data, &b);
+ asn1_end_tag(data);
+ return !data->has_error && (v == b);
+}