-/*
+/*
Unix SMB/CIFS implementation.
simple ASN1 routines
Copyright (C) Andrew Tridgell 2001
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
}
len = data->ofs - (nesting->start+1);
/* yes, this is ugly. We don't know in advance how many bytes the length
- of a tag will take, so we assumed 1 byte. If we were wrong then we
+ of a tag will take, so we assumed 1 byte. If we were wrong then we
need to correct our mistake */
if (len > 0xFFFFFF) {
data->data[nesting->start] = 0x84;
{
uint8_t b;
struct nesting *nesting;
-
+
if (!asn1_read_uint8(data, &b))
return false;
return false;
nesting->taglen = b;
while (n > 1) {
- if (!asn1_read_uint8(data, &b))
+ if (!asn1_read_uint8(data, &b))
return false;
nesting->taglen = (nesting->taglen << 8) | b;
n--;
}
*i = (*i << 8) + b;
}
- return !data->has_error;
-
+ return !data->has_error;
}
/* read an integer */
if (!asn1_start_tag(data, ASN1_INTEGER)) return false;
if (!asn1_read_implicit_Integer(data, i)) return false;
- return asn1_end_tag(data);
+ return asn1_end_tag(data);
}
/* read a BIT STRING */
bool asn1_read_enumerated(struct asn1_data *data, int *v)
{
*v = 0;
-
+
if (!asn1_start_tag(data, ASN1_ENUMERATED)) return false;
while (!data->has_error && asn1_tag_remaining(data)>0) {
uint8_t b;
}
*v = (*v << 8) + b;
}
- return asn1_end_tag(data);
+ return asn1_end_tag(data);
}
/* check a enumerated value is correct */
if (size > blob.length) {
*packet_size = size;
return EAGAIN;
- }
+ }
*packet_size = size;
return 0;
-/*
- Unix SMB/CIFS implementation.
+/*
+ Unix SMB/CIFS implementation.
simple ASN1 code
Copyright (C) Andrew Tridgell 2001
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/