summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/asn.1
Commit message (Collapse)AuthorAgeFilesLines
...
* ASN.1 code passes uninitialized values aroundTom Yu2002-10-084-137/+239
| | | | | | | | | | | | | | | | | | | | | | * asn1_get.c (asn1_get_tag_indef): Stomp on asn1class, construction, retlen, and indef, even if we've hit the end of the buffer, to avoid passing uninitialized values around. * asn1_k_decode.c: Reformat somewhat and add comments to demystify things a little. (opt_field): Fix to explicitly check for end of subbuf before verifying the pre-fetched tag, which may have been stomped on by asn1_get_tag_indef() encountering end-of-buffer. * krb5_decode.c (opt_field, opt_lenfield): Fix to explicitly check for end of subbuf before verifying the pre-fetched tag, which may have been stomped on by asn1_get_tag_indef() encountering end-of-buffer. ticket: new target_version: 1.3 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14913 dc483132-0cff-0310-8789-dd5450dbe970
* Use prototype style definitions for functions. Avoid variable name "class"Ken Raeburn2002-09-0314-759/+297
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14810 dc483132-0cff-0310-8789-dd5450dbe970
* * Makefile.in: Revert $(S)=>/ change, for Windows supportKen Raeburn2002-08-292-1/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14786 dc483132-0cff-0310-8789-dd5450dbe970
* Change $(S)=>/ and $(U)=>.. globallyKen Raeburn2002-08-232-1/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14761 dc483132-0cff-0310-8789-dd5450dbe970
* update depsKen Raeburn2002-08-151-8/+18
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14716 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_encode.c (asn1_encode_generaltime): Remove call toTom Yu2002-06-242-3/+6
| | | | | | | unix_time_to_msl_time(), as it's Mac OS 9 specific and was missed in the previous change. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14562 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_encode.c: Removed unused Mac OS 9 codeTom Yu2002-06-242-8/+18
| | | | | | | | | | | * asn1_encode.c (asn1_encode_generaltime): Fixed the Mac code to use the correct epoch. * asn1_encode.c: Updated Utilities.h #include [pullups from 1-2-2-branch] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14561 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_get.c (asn1_get_length): Check for negative length.Tom Yu2002-06-242-0/+7
| | | | | | [pullup from 1-2-2-branch] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14560 dc483132-0cff-0310-8789-dd5450dbe970
* update dependenciesKen Raeburn2002-06-151-21/+18
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14522 dc483132-0cff-0310-8789-dd5450dbe970
* rebuild dependenciesKen Raeburn2002-06-151-22/+22
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14516 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1buf.c (asn1buf_remove_octetstring, asn1buf_remove_charstring): Fix boundsKen Raeburn2002-04-102-4/+11
| | | | | | test for correctness in overflow cases. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14370 dc483132-0cff-0310-8789-dd5450dbe970
* In directories building libraries, generate dependencies for .so/.po files tooKen Raeburn2001-10-201-10/+10
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13828 dc483132-0cff-0310-8789-dd5450dbe970
* Update automatic dependencies to work on Windows by using $(OUTPRE) andKen Raeburn2001-10-111-38/+40
| | | | | | | $(OBJEXT). Change a couple of UNIX rules to not trigger incorrectly on Windows. Rebuild dependencies. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13801 dc483132-0cff-0310-8789-dd5450dbe970
* Don't conditionalize prototypes; delete macros supporting it. (Maybe overdone;Ken Raeburn2001-10-1010-186/+189
| | | | | | don't worry about restoring them when importing new versions of code.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13792 dc483132-0cff-0310-8789-dd5450dbe970
* updated dependencies for latest make-depend target codeKen Raeburn2001-09-061-22/+21
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13734 dc483132-0cff-0310-8789-dd5450dbe970
* dependenciesKen Raeburn2001-09-011-0/+57
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13725 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_k_encode.c: (asn1_encode_predicted_sam_response): UseEzra Peisach2001-07-252-1/+7
| | | | | | | asn1_encode_charstring() instead of asn1_decode_octetstring() for krb5_data. (signed vs. unsigned) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13635 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_k_decode.c (asn1_decode_predicted_sam_response): UseEzra Peisach2001-06-122-2/+8
| | | | | | | asn1_decode_charstring() instead of asn1_decode_octetstring() to decode krb5_data. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13338 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1buf.c (asn1buf_sync): Add new arguments to include the fullTom Yu2000-10-266-71/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | complement of data about a prefetched tag, as well as to indicate whether the prefetched tag or the surrounding sequence is of an indefinite length. (asn1buf_skiptail): Add new arguments to indicate whether the prefetched tag is indefinite, as well as its length. This facilitates proper skipping of trailing garbage. (asn1buf_remains): Add new argument to indicate whether the surrounding encoding is indefinite. Don't advance buf->next if an EOC encoding is detected; the caller will do that. * asn1buf.h: Update prototypes. * asn1_get.c (asn1_get_tag_indef): Don't treat EOC encoding as special anymore, since previous behavior was overloading the tag number in a bad way. Also, report a MISMATCH_INDEF error if the tag encoding is for the forbidden primitive constructed encoding. * asn1_k_decode.c (next_tag): Call get_tag_indef() in order to get information about whether the length is indefinite. Don't check the tag class and construction explicitly. (get_eoc): New macro to get a tag and check if it is an EOC encoding. (get_field, opt_field): Move the check for the tag class and construction to here. (get_field_body, get_lenfield_body): Call get_eoc() instead of next_tag() if we are decoding a constructed indefinite encoding. (begin_structure): Use a different variable to indicate whether the sequence is indefinite as opposed to whether an individual field is indefinite. (end_structure): Update to new calling convention of asn1buf_sync(). (sequence_of): Rewrite significantly. (sequence_of_common): Move the bulk of previous sequence_of() macro to here. Does not declare some variables that sequence_of() declares. (sequence_of_no_tagvars): Similar to sequence_of() macro but declares different variables for the purpose of prefetching the final tag. (end_sequence_of_no_tagvars): Similar to end_sequence_of() macro but uses variables declared by the sequence_of_no_tagvars() macro to prefetch the final tag. (asn1_decode_principal_name): Update for new asn1buf_remains() calling convention. Call sequence_of_no_tagvars(), etc. instead of sequence_of(), etc. in order to not declare shadowing block-local variables. (decode_array_body): Update for new asn1buf_remains() calling convention. (asn1_decode_sequence_of_enctype): Update for new asn1buf_remains() calling convention. * krb5_decode.c (next_tag): Call get_tag_indef() in order to get information about whether the length is indefinite. Don't check the tag class and construction explicitly. (get_eoc): New macro to get a tag and check if it is an EOC encoding. (get_field, opt_field): Move the check for the tag class and construction to here. (get_field_body, get_lenfield_body): Call get_eoc() instead of next_tag() if we are decoding a constructed indefinite encoding. (begin_structure): Use a different variable to indicate whether the sequence is indefinite as opposed to whether an individual field is indefinite. (end_structure): Update to new calling convention of asn1buf_sync(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12816 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1buf.h: Lengths are now unsigned int forEzra Peisach2000-10-1716-190/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asn1buf_ensure_space(), asn1buf_expand(), asn1buf_imbed(), asn1buf_sync(), asn1buf_insert_octetstring(), asn1buf_insert_charstring(), asn1_remove_octetstring(), asn1buf_remove_charstring(), * krb5_decode.c, krb5_encode.c: Length fields are unsigned ints. * asn1_make.c, asn1_make.h: Prototypes changed to use an unsigned int * in_len and retlen for: asn1_make_etag(), asn1_make_tag(), asn1_make_sequence(), asn1_make_set(), asn1_make_string(), asn1_make_length(), asn1_make_id(). * asn1_k_encode.h, asn1_k_encode.c: Change length fields to unsigned ints for all functions. (asn1_encode_etype_info_entry): Test for KRB5_ETYPE_NO_SALT instead of -1. * asn1_k_decode.c (asn1_decode_etype_info_entry): Use a length of KRB5_ETYPE_NO_SALT to indicate the optional salt not being present. (instead of -1). (setup): Length is now unsigned int. * asn1_get.c, asn1_get.h: Change retlent to unsigned int * for asn1_get_tag(), asn1_get_tag_indef(), asn1_get_sequence, asn1_get_length(). * asn1_encode.c, asn1_encode.h: Change retlen to unsigned int * for asn1_encode_integer(), asn1_encode_unsigned_integer(), asn1_encode_octetstring(), asn1_encode_charstring(), asn1_encode_printable_string(), asn1_encode_ia5string(), asn1_encode_generaltime(), asn1_encode_generalstring() * asn1_decode.c, asn1_decode.h: Change retlen to unsigned int * for asn1_decode_octetstring(), asn1_decode_generalstring(), asn1_decode_charstring(), git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12779 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_get.c (asn1_get_tag_indef): Fix to not deref random garbageTom Yu2000-09-272-1/+8
| | | | | | | while checking for EOC encoding. At least the indefinite decoding breaks consistently now. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12684 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_k_decode.c (asn1_decode_last_req_entry): Decode the lr_typeEzra Peisach2000-08-073-1/+24
| | | | | | | | | | as an int32. Handle backwards compatibility if KRB5_GENEROUS_LR_TYPE is defined. * krbasn1.h: Define KRB5_GENEROUS_LR_TYPE for compatibility with one byte negative lr_types which are sent as a positive integer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12608 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1buf.h (asn1buf_insert_octet): Define using __inline__ ratherTom Yu2000-06-302-1/+6
| | | | | | than inline in order to shut up gcc -pedantic. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12474 dc483132-0cff-0310-8789-dd5450dbe970
* asn1_get.c (asn1_get_tag): Remove unused variableEzra Peisach2000-06-292-1/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12452 dc483132-0cff-0310-8789-dd5450dbe970
* Change wsanchez@apple -> tritan@mitWilfredo Sanchez2000-06-011-2/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12331 dc483132-0cff-0310-8789-dd5450dbe970
* added flags field to predicted_sam_response (fcusack)Ken Raeburn2000-02-073-11/+13
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12008 dc483132-0cff-0310-8789-dd5450dbe970
* more fcusack changes - rest of first setKen Raeburn2000-02-073-2/+18
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12006 dc483132-0cff-0310-8789-dd5450dbe970
* Frank Cusack changes, set 1, diffs 1-3 of 4Ken Raeburn2000-02-073-2/+8
| | | | | | | | Rename "sam_passcode" field to "sam_sad". Add data to predicted-sam-response structure, in part to (prepare to) help with replay detection. Fix some memory allocation problems. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12005 dc483132-0cff-0310-8789-dd5450dbe970
* * krb5_decode.c (krb5_decode_ticket): Add function to provideDanilo Almeida2000-02-022-0/+14
| | | | | | decode_krb5_ticket functionality as part of krb5 API. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11983 dc483132-0cff-0310-8789-dd5450dbe970
* * krb5_decode.c (begin_structure): Update to deal with indefiniteTom Yu1999-11-017-20/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | encodings better; also call asn1_get_sequence(). * asn1_k_decode.c (sequence_of): Update to deal with indefinite encodings better. (begin_structure): Update to deal with indefinite encodings better; also call asn1_get_sequence(). * asn1_get.h: Update prototypes for asn1_get_tag_indef(), asn1_get_tag(), asn1_get_sequence(), asn1_get_length(). * asn1_get.c (asn1_get_tag_indef): New function; get tag info, lengths, etc. as well as flag indicating whether the length is indefinite. (asn1_get_tag): Modify to just call asn1_get_tag_indef(). (asn1_get_sequence): Call asn1_get_tag_indef() in order to determine whether encoding is indefinite length. (asn1_get_length): Add "indef" arg to indicate whether an encoding has an indefinite length. * asn1buf.h: Update asn1buf_imbed() prototype. * asn1buf.c (asn1buf_imbed): Add "indef" arg so that we don't treat a definite zero-length encoding as an indefinite encoding. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11890 dc483132-0cff-0310-8789-dd5450dbe970
* log tritan's changesTom Yu1999-10-261-0/+7
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11877 dc483132-0cff-0310-8789-dd5450dbe970
* Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, LOCAL_INCLUDES suchWilfredo Sanchez1999-10-261-1/+0
| | | | | | | that one can override CFLAGS from the command line without losing CPP search patchs and defines. Some associated Makefile cleanup. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11876 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_decode.c (asn1_decode_integer): Initialize "n", to keep gcc happyKen Raeburn1999-10-222-1/+6
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11875 dc483132-0cff-0310-8789-dd5450dbe970
* fix typos in commentsKen Raeburn1999-10-221-2/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11874 dc483132-0cff-0310-8789-dd5450dbe970
* copyright notice updates from 1.1 branchKen Raeburn1999-09-2418-18/+72
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11853 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_decode.c (asn1_decode_integer): Fix to deal with overflowsTom Yu1999-07-112-8/+30
| | | | | | | | and negative integers. (asn1_decode_unsigned_integer): Fix to deal with overflows and to return errors on encountering negative integers. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11558 dc483132-0cff-0310-8789-dd5450dbe970
* * KRB5-asn.py (PA-SAM-RESPONSE): Fix syntax error -- comma separating sequenceKen Raeburn1999-07-062-4/+10
| | | | | | components doesn't belong buried in a comment. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11545 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1buf.c (asn1buf_sync): Add length parameter to disambiguateTom Yu1999-07-045-7/+21
| | | | | | | | | | | | | | | constructed-indefinite encoding from constructed-definite encoding which happens to end at the same place as the enclosing buf. * asn1buf.h: Update to match definition. * krb5_decode.c (end_structure): Update to deal with additional length parameter to asn1buf_sync(). * asn1_k_decode.c (end_sequence_of, end_structure): Update to deal with additional length parameter to asn1buf_sync(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11542 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1buf.h: New prototpyes for asn1buf_sync() andTom Yu1999-07-035-10/+71
| | | | | | | | | | | | | | | | | | | asn1buf_skiptail(). * asn1buf.c (asn1buf_sync): Fix to deal with constructed-indefinite encodings with trailing fields. As a result, this requires that the most recently read tag number be passed in. (asn1buf_skiptail): New helper function to skip trailing fields in a constructed-indefinite encoding. * krb5_decode.c (end_structure): Hack to deal with changed asn1buf_sync(). * asn1_k_decode.c (end_structure, end_sequence_of): Hack to deal with changed asn1buf_sync(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11541 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1buf.c (asn1buf_sync): Interim fix for DCE compat problemTom Yu1999-07-012-1/+14
| | | | | | with indefinite length encodings. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11540 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_encode.c (asn1_encode_generaltime): Fix minor bug inTom Yu1999-06-172-1/+6
| | | | | | bounds-checking for tm_year: 1900 + 8099 = 9999. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11521 dc483132-0cff-0310-8789-dd5450dbe970
* Do win32 build in subdirDanilo Almeida1999-05-102-11/+15
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11432 dc483132-0cff-0310-8789-dd5450dbe970
* Makefile.in: Set the myfulldir and mydir variables (which are relativeTheodore Tso1998-12-052-0/+7
| | | | | | to buildtop and thisconfigdir, respectively.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11087 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_k_decode.c (asn1_decode_krb5_flags): Fix previous toTom Yu1998-12-042-1/+8
| | | | | | properly left-justify bit strings less than 32 bits. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11057 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_k_decode.c (asn1_decode_krb5_flags): Modify to deal withTom Yu1998-12-042-7/+22
| | | | | | | | BIT STRING values that are not exactly 32 bits. Throw away bits beyond number 31 in a bit string for now. Deal with masking out unused bits. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11055 dc483132-0cff-0310-8789-dd5450dbe970
* pull up 3des implementation from the marc-3des branchMarc Horowitz1998-10-302-1/+8
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11001 dc483132-0cff-0310-8789-dd5450dbe970
* Replaced preprocessor symbol _MACINTOSH with macintosh, since macintosh is ↵Miro Jurisic1998-07-171-1/+1
| | | | | | the standard symbol defined by all Mac compiler (oh, sure, it doesn't have _. but at least it's always there) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10653 dc483132-0cff-0310-8789-dd5450dbe970
* asn1_encode.c: Make the magic Macintosh EPOCH offset be 70 yearsTheodore Tso1998-07-022-1/+7
| | | | | | | instead of 66 years, since CodeWarrior Pro 2 now bases everything off of 1900. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10619 dc483132-0cff-0310-8789-dd5450dbe970
* * asn1_encode.c (asn1_encode_generaltime): Sanity check the returnTom Yu1998-04-172-1/+16
| | | | | | from gmtime() to avoid overruns. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10534 dc483132-0cff-0310-8789-dd5450dbe970
* Collapse lib/krb5's configure.in files into a single top-levelTheodore Tso1998-02-283-5/+7
| | | | | | configure.in file. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10476 dc483132-0cff-0310-8789-dd5450dbe970