Commit Graph

57 Commits

Author SHA1 Message Date
Love Hörnquist Åstrand
9ab118ca78 (der_get_time): avoid using wrapping of octet_string and realloc.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21369 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-27 10:14:39 +00:00
Love Hörnquist Åstrand
0c489117c5 No need to undef timetm, we don't use it any more.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21367 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-27 10:07:26 +00:00
Love Hörnquist Åstrand
25767cac3f Add malloc paranoid, it shouldn't matter if sizeof(uint{32,16}_t) is 4,2.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20570 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-27 14:06:27 +00:00
Love Hörnquist Åstrand
6f625101d2 Try to be more correct and don't fall off the end. Pointed out by
Kevin Coffman.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20372 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-17 17:47:42 +00:00
Love Hörnquist Åstrand
2e356b6607 Allow trailing NULs. We allow this since MIT Kerberos sends an strings
in the NEED_PREAUTH case that includes a trailing NUL.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20296 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-11 11:09:37 +00:00
Love Hörnquist Åstrand
848c63a5fd Check for NUL characters in string and return ASN1_BAD_CHARACTER
error-code if we find them.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20011 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-20 21:53:32 +00:00
Love Hörnquist Åstrand
983b89b811 Add VisibleString parsing
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19539 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-28 17:15:05 +00:00
Love Hörnquist Åstrand
dbc2843b90 (generalizedtime2time): always use _der_timegm.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18609 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-19 16:27:44 +00:00
Love Hörnquist Åstrand
9dc0d8d6b4 rename the buildin timegm to _der_timegm
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18447 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-14 09:17:43 +00:00
Love Hörnquist Åstrand
f4f9013804 prefix primitive types with der_
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18443 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-14 05:36:34 +00:00
Love Hörnquist Åstrand
d56c2c1496 (der_get_heim_integer): revert part of previous
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17685 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-06-22 07:13:06 +00:00
Love Hörnquist Åstrand
9e5f91e48b (der_get_heim_integer): Add more checks
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17679 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-06-22 03:54:50 +00:00
Love Hörnquist Åstrand
b8c2cec844 (der_get_heim_integer): handle negative integers.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16635 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-20 10:03:50 +00:00
Love Hörnquist Åstrand
dd801b3ca3 (der_match_tag): tag is unsigned int.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15670 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-19 18:04:00 +00:00
Love Hörnquist Åstrand
0f15be4a2d rewrite integer overflow tests w/o SIZE_T_MAX
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15662 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-19 15:08:18 +00:00
Love Hörnquist Åstrand
b838707d0e Commit much improved ASN.1 compiler from joda-choice-branch.
Highlighs for the compiler is support for CHOICE and in general better
support for tags. This compiler support most of what is needed for
PK-INIT, LDAP, X.509, PKCS-12 and many other protocols.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15617 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-12 06:27:42 +00:00
Love Hörnquist Åstrand
7cb5f5ba32 revert previous until I've have cleaned libvers mess
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15589 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-07 22:11:00 +00:00
Love Hörnquist Åstrand
421d2b645f don't include <version.h>, it forces unnecessary rebuilds
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15579 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-07 20:48:57 +00:00
Love Hörnquist Åstrand
8e78ed6e48 prefix Der_class with ASN1_C_ to avoid problems with system headerfiles that pollute the name space
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15255 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-29 14:23:01 +00:00
Love Hörnquist Åstrand
f04518dc7f (decode_*): name all tag-length variables the same
(decode_enumerated): check that the tag-length is not longer the length


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14189 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-09-05 15:29:22 +00:00
Love Hörnquist Åstrand
861f615ca9 (decode_boolean): fail if length of tag is larger then len
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14187 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-09-05 15:23:43 +00:00
Love Hörnquist Åstrand
8b7d2a4dc4 1.28.2.16: (der_get_oid): handle all oid components being smaller then
127 and allocate one extra element since first byte is split to to
elements.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13735 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-04-21 00:53:58 +00:00
Love Hörnquist Åstrand
8b8bcb8c9b add boolan support
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12944 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-10-03 00:28:29 +00:00
Love Hörnquist Åstrand
939b444ca3 prefix typedef\'s and structs with heim_
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12438 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-07-15 13:57:32 +00:00
Jacques A. Vidrine
9cb7b201a4 Check for truncated integers: the encoded length may be greater than
the data buffer.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11339 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-09-03 16:21:49 +00:00
Assar Westerlund
3284bae206 (der_get_int): handle len == 0. based on a patch from Love
<lha@stacken.kth.se>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11211 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-08-22 19:11:07 +00:00
Assar Westerlund
6455d35479 (der_get_oid): add `n', increment p
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10753 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-09-28 22:53:24 +00:00
Assar Westerlund
b6f1d52a01 add decode_oid
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10749 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-09-27 16:20:35 +00:00
Assar Westerlund
2bcae56ac3 add ENUMERATED and OBJECT IDENTIFIER
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10741 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-09-25 13:39:27 +00:00
Assar Westerlund
86ba9a4e1f (decode_unsigned): add
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8126 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-04-06 17:19:53 +00:00
Johan Danielsson
c5b916ca6f remove advertising clause
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7464 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-02 17:05:13 +00:00
Assar Westerlund
a74d27d3d7 const-ize
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7130 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-10-10 04:55:28 +00:00
Assar Westerlund
798343b01a (decode_general_string): remember to advance ret over the length-len
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6998 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-09-21 04:33:05 +00:00
Assar Westerlund
01959cb376 make functions more consistent
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6994 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-09-20 22:37:43 +00:00
Assar Westerlund
90737baeff (der_get_unsigned): new function
(der_get_int): handle signed integers


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5347 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-02-13 16:14:27 +00:00
Assar Westerlund
25ecde8225 (der_get_length): fix test of len
(der_get_tag): more type correctness


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5210 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-11-21 22:14:42 +00:00
Johan Danielsson
f3a74b747f Allow passing NULL size.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3995 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-15 23:32:43 +00:00
Johan Danielsson
7a5f95f86d Special-case indefinite encoding.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3668 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-10-26 03:50:28 +00:00
Johan Danielsson
9766fd900b Zero tm
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2941 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-12 01:55:33 +00:00
Johan Danielsson
39fefce60c Include version string.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2911 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-11 15:33:52 +00:00
Johan Danielsson
5a32a5c8e7 Add copyright notice.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2389 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-16 21:40:05 +00:00
Assar Westerlund
c1439d2cd8 changed asn1_locl.h to gen_locl.h and der_locl.h
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2328 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-15 20:02:05 +00:00
Assar Westerlund
c4c112e666 (der_get_octet_string): fixed typo
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1961 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-02 21:16:16 +00:00
Johan Danielsson
372881f5ef Now all decode_* and encode_* functions now take a final size_t*
argument, that they return the size in. Return values are zero for
success, and anything else (such as some ASN1_* constant) for error.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1951 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-01 23:52:30 +00:00
Johan Danielsson
f13518ca8f krb5_data -> octet_string, char * -> general_string
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1873 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-06-09 22:43:04 +00:00
Assar Westerlund
b914fb3230 (generalizedtime2time): use `timegm'
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1573 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-04-13 22:13:53 +00:00
Johan Danielsson
cddcb222c6 fix_dce moved from der_put.c
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1452 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-03-17 10:39:20 +00:00
Johan Danielsson
e2653a19af Fix include files.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1449 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-03-17 10:36:32 +00:00
Assar Westerlund
93dbc8da93 Id
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1427 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-03-14 10:22:48 +00:00
Assar Westerlund
e0d6f79eb2 (der_match_tag_and_length): new function
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1345 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-03-10 00:43:36 +00:00