From 3d8346b4c1911d90a458e4fb456cddf95d79ba4d Mon Sep 17 00:00:00 2001 From: Miro Jurisic Date: Tue, 31 Aug 1999 21:30:55 +0000 Subject: [PATCH] Updated the glue to the most recent list of functions (as per .h files) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11741 dc483132-0cff-0310-8789-dd5450dbe970 --- src/mac/CFMGlue.pl | 426 ++++++++++++++++++++++++------------ src/mac/GSS.CFMglue.proto.h | 51 ++++- src/mac/K5.CFMglue.cin | 3 +- src/mac/K5.CFMglue.proto.h | 276 ++++++++++++++++++++--- 4 files changed, 575 insertions(+), 181 deletions(-) diff --git a/src/mac/CFMGlue.pl b/src/mac/CFMGlue.pl index f74a3662d..f6386bb80 100644 --- a/src/mac/CFMGlue.pl +++ b/src/mac/CFMGlue.pl @@ -1,158 +1,298 @@ -#!/usr/athena/bin/perl -w +#!/usr/local/bin/perl -w +use strict; # Turn on careful syntax checking +use 5.002; # Require Perl 5.002 or later + +# Pre-declare globals, as required by "use strict" +use vars qw(%RESERVEDWORDS $file $prototype); + +# C words which aren't a type or a parameter name +# [digit] is special cased later on... %RESERVEDWORDS = ( - const => "const", - "*" => "*", - "[]" => "[]", - struct => "struct", - enum => "enum", - union => "union" + const => "const", + "*" => "*", + "[]" => "[]", + struct => "struct", + enum => "enum", + union => "union", + unsigned => "unsigned", + register => "register" ); -while() +# Read the entire file into $file +{ + local $/; + undef $/; # Ignore end-of-line delimiters in the file + $file .= ; +} + +# Remove the C and C++ comments from the file. +# If this regexp scares you, don't worry, it scares us too. +$file =~ s@/ # Both kinds of comment begin with a / + # First, process /* ... */ + ((\*[^*]*\*+ # 1: Identify /**, /***, /* foo *, etc. + ([^/*][^*]*\*+)* # 2: Match nothing, x*, x/*, x/y*, x*y* etc. + /) # 3: Look for the trailing /. If not present, back up + # through the matches from step 2 (x*y* becomes x*) + #### if we get here, we have /* ... */ + | # Or, it's // and we just need to match to the end of the line + (/.*?\n)) # 4. Slash, shortest possible run of characters ending in newline (\n) + @\n@xg; # => Replace match with a newline. + ### "x" modifier allows whitespace and comments in patterns + ### "g" modifier means "do this globally" + +$file =~ tr! \t\n! !s; # Convert newlines, tabs, and runs of spaces into single spaces + +foreach $prototype (split /;/, $file) # Break string apart at semicolons, pass each piece to our Convert routine { - chop($_); - $prototype = $_; - @splitup = split(/\s*\(\s*/, $prototype); - - # the return value type and the function name: - $temp = $splitup[0]; - $temp =~ s/\s*\*\s*/ \* /g; # add spaces around * - @funcAndArgs = split(/\s+/, $temp); - $functionName = $funcAndArgs[$#funcAndArgs]; - - # Is this function already in the Hash Table? - if(!exists($FUNCTIONS{$functionName})) - { - $FUNCTIONS{$functionName}{prototypeText} = $prototype; - pop @{funcAndArgs}; - $FUNCTIONS{$functionName}{returnType} = join(' ', @funcAndArgs); + Convert($prototype); +} + +exit (0); + +# ======================================== +# Subroutines follow +# ======================================== + +sub Convert() +{ + # Take our special C-style function prototypes and print out the + # appropriate glue code. + + my $prototype = shift; + my ($returnType, $functionName, $paramString); + my (@parameters, @types); + + return if ($prototype =~ /^\s*$/); # Ignore blank lines + # Use custom function to remove leading & trailing spaces & + # collapse runs of spaces. + $prototype = StripSpaces($prototype); + + # ==================== + # STAGE 1.1: Get the function name and return type. + # Do general syntax checking. + # ==================== + + # See if we have a legal prototype and begin parsing. A legal prototype has + # a return type (optional), function name, and parameter list. + unless ($prototype =~ /((\w+\*? )*(\w+\*?)) (\w+)\s*\((.*)\)$/) + { + die "Prototype \"$prototype;\" does not appear to be a legal prototype.\n"; + } + + # That unless had a nice side effect -- the parentheses in the regular expression + # stuffed the matching parts of the expression into variables $1, $2, and $3. + + ($returnType, $functionName) = ($1, $4); + # Kill 2 birds at a time -- get rid of leading & trailing spaces *and* get an + # empty string back if there are no parameters + $paramString = StripSpaces($5); + + # Insist on having an argument list in the prototype + unless ($paramString) + { + die("Prototype: \"$prototype;\" has no arguments.\n" . + "This is ambiguous between C and C++ (please specify " . + "either (int) or (void)).\n"); + } + + # Check for variable arguments by looking for + # "va_list " or "..." + if(($paramString =~ /va_list\s+\S+/) or # va_list + spaces + not-a-spaces + ($paramString =~ /\Q.../)) # \Q = "quote metacharacters" => \.\.\. + { + die("Prototype: \"$prototype;\" takes a variable " . + "number of arguments. Variable arguments are not " . + "supported by CFM Glue.\n"); + } + + # ==================== + # STAGE 1.2: Digest the parameter list. + # ==================== + + if ($paramString eq "void") + { + $parameters[0] = "void"; + $types[0] = "void"; + } + else + { + # The function has nonvoid arguments - # the arguments: - @splitup2 = split(/\s*\)\s*/, $splitup[1]); - @argsAndParams = split(/\s*,\s*/, $splitup2[0]); + # Add spaces around * and turn [#] into [#] with spaces around it + # for ease of parsing + $paramString =~ s/\s*\*\s*/ \* /g; + $paramString =~ s/\s*\[(\d*)\]\s*/ [$1] /g; + + # Extract the list elements + my @arguments = split /,\s*/, $paramString; - for($i = 0, $j = 1; $i <= $#argsAndParams; $i++, $j++) - { - $temp = $argsAndParams[$i]; - $temp =~ s/\s*\*\s*/ \* /g; # add spaces around * - $temp =~ s/\s*\[\]\s*/ \[\] /g; # add spaces around [] - - @elements = split(/\s+/, $temp); - - # Is there a parameter name in this argument? - $identifierCount = 0; - foreach $element (@elements) - { - if(!exists($RESERVEDWORDS{$element})) { - $identifierCount++; + # Make sure we don't have more than 13 arguments + if ($#arguments >= 13) + { + die "Prototype \"$prototype;\" has more than 13 arguments,\n". + "which the CFM68K glue will not support."; } - } - - if(($identifierCount > 2) or ($identifierCount < 1)) { - print("************** $argsAndParams ****************"); - die; - } - - if($identifierCount >= 2) { - $param = $elements[$#elements]; - pop(@elements); - if($param eq "[]") { - $param = $elements[$#elements]; - pop(@elements); - push(@elements, '*'); + + # We need to look at each argument and come out with two lists: a list + # of parameter names and a corresponding list of parameter types. For example: + # ( const int x, short y[], int ) + # needs to become two lists: + # @parameters = ("x", "y", "__param0") + # @elements = ("const int", "short *", int) + my $i = 0; # parameter counter + foreach my $argument (@arguments) + { + my @elements = split(' ', $argument); + + # A legal argument will have a name and/or a parameter type. + # It might _also_ have some C keywords + # We'll syntax check the argument by counting the number of things + # which are names and/or variable types + my $identifierCount = grep { !$RESERVEDWORDS{$_} && !/\[\d*\]/ } @elements; + + if ($identifierCount == 1) { + # We have a type without a name, so generate an arbitrary unique name + push @parameters, "__param" . $i; + } + elsif ($identifierCount == 2) { + # We have a type and a name. We'll assume the name is the last thing seen, + my $paramName = pop @elements; + # ...but have to make certain it's not a qualified array reference + if ($paramName =~ /\[\d*\]/) + { + # Whoops...the argument ended in a [], so extract the name and put back + # the array notation + my $temp = $paramName; + $paramName = pop @elements; + push @elements, $temp; + } + push @parameters, $paramName; + } + else # $identifierCount == 0 or $identifierCount > 2 + { + die("Prototype: \"$prototype;\" has an " . + "invalid number ($identifierCount)" . + " of non-reserved words in argument '$argument'.\n"); + } + + # Replace all "[]" with "*" to turn array references into pointers. + # "map" sets $_ to each array element in turn; modifying $_ modifies + # the corresponding value in the array. (s -- substutition -- works + # on $_ by default.) + map { s/\[\d*\]/*/ } @elements; + + push @types, join(' ', @elements); # Construct a type definition + + # Increment the argument counter: + $i++; } - $type = join(' ', @elements); - } else { - $type = $argsAndParams[$i]; - $param = "param" . $j; - } - $FUNCTIONS{$functionName}{typeList}[$i] = $type; - $FUNCTIONS{$functionName}{paramList}[$i] = $param; } - } -} -foreach $function (keys(%FUNCTIONS)) -{ - # the variables we will be playing with: - $name = $function; - $retType = $FUNCTIONS{$function}{returnType}; - $prototype = $FUNCTIONS{$function}{prototypeText}; - @args = @{ $FUNCTIONS{$function}{typeList} }; - @params = @{ $FUNCTIONS{$function}{paramList} }; - - - # Now Generate the ProcInfo Macro: - # -------------------------------- - print("/**** $name ****/\n"); - print("/* $prototype */\n\n"); - - print("enum {\n"); - print(" $name" . "_ProcInfo = kThinkCStackBased\n"); - if($retType ne "void") { - print(" | RESULT_SIZE(SIZE_CODE(sizeof($retType)))\n"); - } - for($i = 0, $j = 1; $i <= $#args; $i++, $j++) - { - $arg = $args[$i]; - print(" | STACK_ROUTINE_PARAMETER($j, SIZE_CODE(sizeof($arg)))\n"); - } - print("};\n\n"); - - # Now Generate the ProcPtr Typedef - # -------------------------------- - print("typedef "); - print("$retType "); - print("(*$name" . "_ProcPtrType)("); - - for($i = 0; $i<=$#args; $i++) { - $arg = $args[$i]; - print("$arg"); - if ($i ne $#args) { - print (", "); - } - } - print(");\n"); - - - # Now Generate the Static 68K Function Declaration: - # ------------------------------------------------- - print("$retType $name (\n"); - for($i = 0; $i <= $#args; $i++) - { - for($j = 0; $j <= length($retType); $j++) { - print(" "); + # ==================== + # STAGE 2: Print out the glue. + # ==================== + + # Generate the ProcInfo Macro: + # ---------------------------- + my $result = ""; # Will be inserted into the final macro + if ($returnType ne "void") { + $result = "\n | RESULT_SIZE(SIZE_CODE(sizeof($returnType)))"; } - print($args[$i] . ' ' . $params[$i]); - if($i >= $#args) { - print(")\n"); - } else { - print(",\n"); + + # Convert a list of parameter types into entries for the macro. + # All non-void parameters need to have a line in the final macro. + my @parameterMacros; + my $paramCount = -1; + @parameterMacros = map { $paramCount++; $_ eq "void" ? "" : + " | STACK_ROUTINE_PARAMETER(" . ($paramCount + 1) . ", SIZE_CODE(sizeof($_)))" } @types; + my $macroString = join "\n", @parameterMacros; + + print <= $#args) { - print(");\n"); - } else { - print(", "); + else + { + my @joinedList; + # Merge the parameter and type lists together + foreach my $i (0..$#types) + { + push @joinedList, ($types[$i] . ' ' . $parameters[$i]); + } + + # Build a list of parameters where each parameter is aligned vertically + # beneath the one above. + # "' ' x 5" is a Perl technique to get a string of 5 spaces + $fnArguments = join (",\n".(' ' x length($functionDec)), @joinedList); + } + + # Create a list of parameters to pass to the 68K function + my $fnParams = ""; + if($types[0] ne "void") { + $fnParams = join ", ", @parameters; } - } - - print("}\n\n\n"); + + # Do we have an explicit return statement? This depends on the return type + my $returnAction = " "; + $returnAction = "return " if ($returnType ne "void"); + + # The following code introduces a new Perl trick -- ${a} is the same as $a in a string + # (interpolate the value of variable $a); the brackets are used to seperate the variable + # name from the text immediately following the variable name so the Perl interpreter + # doesn't go looking for the wrong variable. + print < -#include /* Hardcode library fragment name here */ -#define kLibraryName "\pK5Library" +#define kLibraryName "\pMIT Kerberos¥Kerberos5Lib" diff --git a/src/mac/K5.CFMglue.proto.h b/src/mac/K5.CFMglue.proto.h index 65a04414d..ddf86adf5 100644 --- a/src/mac/K5.CFMglue.proto.h +++ b/src/mac/K5.CFMglue.proto.h @@ -1,27 +1,249 @@ -krb5_error_code krb5_init_context(krb5_context *); -void krb5_free_context(krb5_context); -krb5_error_code krb5_get_credentials(krb5_context, const krb5_flags, krb5_ccache, krb5_creds *, krb5_creds **); -krb5_error_code krb5_mk_req_extended(krb5_context, krb5_auth_context *, const krb5_flags, krb5_data *, krb5_creds *, krb5_data * ); -krb5_error_code krb5_rd_rep(krb5_context, krb5_auth_context, const krb5_data *, krb5_ap_rep_enc_part **); -krb5_error_code krb5_copy_keyblock(krb5_context, const krb5_keyblock *, krb5_keyblock **); -void krb5_init_ets(krb5_context); -krb5_error_code krb5_cc_default(krb5_context, krb5_ccache *); -void krb5_free_principal(krb5_context, krb5_principal ); -void krb5_free_creds(krb5_context, krb5_creds *); -void krb5_free_cred_contents(krb5_context, krb5_creds *); -void krb5_free_keyblock(krb5_context, krb5_keyblock *); -void krb5_free_ap_rep_enc_part(krb5_context, krb5_ap_rep_enc_part *); -krb5_error_code krb5_sname_to_principal(krb5_context, const char *, const char *, krb5_int32, krb5_principal *); -krb5_error_code krb5_fwd_tgt_creds(krb5_context, krb5_auth_context, char *, krb5_principal, krb5_principal, krb5_ccache, int forwardable, krb5_data *); -krb5_error_code krb5_auth_con_init(krb5_context, krb5_auth_context *); -krb5_error_code krb5_auth_con_free(krb5_context, krb5_auth_context); -krb5_error_code krb5_auth_con_setflags(krb5_context, krb5_auth_context, krb5_int32); -krb5_error_code krb5_auth_con_setaddrs(krb5_context, krb5_auth_context, krb5_address *, krb5_address *); -krb5_error_code krb5_auth_con_setports(krb5_context, krb5_auth_context, krb5_address *, krb5_address *); -krb5_error_code krb5_auth_con_getlocalsubkey(krb5_context, krb5_auth_context, krb5_keyblock **); -krb5_error_code krb5_auth_con_genaddrs(krb5_context, krb5_auth_context, int, int); -int mit_des_ecb_encrypt(const mit_des_cblock *, mit_des_cblock *, mit_des_key_schedule , int ); -krb5_error_code mit_des_init_random_key( const krb5_encrypt_block *, const krb5_keyblock *, krb5_pointer *); -int mit_des_key_sched(mit_des_cblock , mit_des_key_schedule ); -krb5_error_code mit_des_random_key( const krb5_encrypt_block *, krb5_pointer , krb5_keyblock * *); -void com_err_va(const char *whoami, errcode_t code, const char *fmt, va_list ap)); +krb5_error_code krb5_c_encrypt (krb5_context context, const krb5_keyblock*key, krb5_keyusage usage, const krb5_data*ivec, const krb5_data*input, krb5_enc_data*output); +krb5_error_code krb5_c_decrypt (krb5_context context, const krb5_keyblock*key, krb5_keyusage usage, const krb5_data*ivec, const krb5_enc_data*input, krb5_data*output); +krb5_error_code krb5_c_encrypt_length (krb5_context context, krb5_enctype enctype, size_t inputlen, size_t*length); +krb5_error_code krb5_c_block_size (krb5_context context, krb5_enctype enctype, size_t*blocksize); +krb5_error_code krb5_c_make_random_key (krb5_context context, krb5_enctype enctype, krb5_keyblock*random_key); +krb5_error_code krb5_c_random_make_octets (krb5_context context, krb5_data*data); +krb5_error_code krb5_c_random_seed (krb5_context context, krb5_data*data); +krb5_error_code krb5_c_string_to_key (krb5_context context, krb5_enctype enctype, const krb5_data*string, const krb5_data*salt, krb5_keyblock*key); +krb5_error_code krb5_c_enctype_compare (krb5_context context, krb5_enctype e1, krb5_enctype e2, krb5_boolean*similar); +krb5_error_code krb5_c_make_checksum (krb5_context context, krb5_cksumtype cksumtype, const krb5_keyblock*key, krb5_keyusage usage, const krb5_data*input, krb5_checksum*cksum); +krb5_error_code krb5_c_verify_checksum (krb5_context context, const krb5_keyblock*key, krb5_keyusage usage, const krb5_data*data, const krb5_checksum*cksum, krb5_boolean*valid); +krb5_error_code krb5_c_checksum_length (krb5_context context, krb5_cksumtype cksumtype, size_t*length); +krb5_error_code krb5_c_keyed_checksum_types (krb5_context context, krb5_enctype enctype, unsigned int*count, krb5_cksumtype**cksumtypes); +krb5_boolean valid_enctype (const krb5_enctype ktype); +krb5_boolean valid_cksumtype (const krb5_cksumtype ctype); +krb5_boolean is_coll_proof_cksum (const krb5_cksumtype ctype); +krb5_boolean is_keyed_cksum (const krb5_cksumtype ctype); +krb5_error_code krb5_encrypt (krb5_context context, const krb5_pointer inptr, krb5_pointer outptr, const size_t size, krb5_encrypt_block* eblock, krb5_pointer ivec); +krb5_error_code krb5_decrypt (krb5_context context, const krb5_pointer inptr, krb5_pointer outptr, const size_t size, krb5_encrypt_block* eblock, krb5_pointer ivec); +krb5_error_code krb5_process_key (krb5_context context, krb5_encrypt_block* eblock, const krb5_keyblock* key); +krb5_error_code krb5_finish_key (krb5_context context, krb5_encrypt_block* eblock); +krb5_error_code krb5_string_to_key (krb5_context context, const krb5_encrypt_block* eblock, krb5_keyblock* keyblock, const krb5_data* data, const krb5_data* salt); +krb5_error_code krb5_init_random_key (krb5_context context, const krb5_encrypt_block* eblock, const krb5_keyblock* keyblock, krb5_pointer* ptr); +krb5_error_code krb5_finish_random_key (krb5_context context, const krb5_encrypt_block* eblock, krb5_pointer* ptr); +krb5_error_code krb5_random_key (krb5_context context, const krb5_encrypt_block* eblock, krb5_pointer ptr, krb5_keyblock** keyblock); +krb5_enctype krb5_eblock_enctype (krb5_context context, const krb5_encrypt_block* eblock); +krb5_error_code krb5_use_enctype (krb5_context context, krb5_encrypt_block* eblock, const krb5_enctype enctype); +size_t krb5_encrypt_size (const size_t length, krb5_enctype crypto); +size_t krb5_checksum_size (krb5_context context, const krb5_cksumtype ctype); +krb5_error_code krb5_calculate_checksum (krb5_context context, const krb5_cksumtype ctype, const krb5_pointer in, const size_t in_length, const krb5_pointer seed, const size_t seed_length, krb5_checksum* outcksum); +krb5_error_code krb5_verify_checksum (krb5_context context, const krb5_cksumtype ctype, const krb5_checksum* cksum, const krb5_pointer in, const size_t in_length, const krb5_pointer seed, const size_t seed_length); +krb5_error_code krb5_random_confounder (size_t, krb5_pointer); +krb5_error_code krb5_encrypt_data (krb5_context context, krb5_keyblock*key, krb5_pointer ivec, krb5_data*data, krb5_enc_data*enc_data); +krb5_error_code krb5_decrypt_data (krb5_context context, krb5_keyblock*key, krb5_pointer ivec, krb5_enc_data*data, krb5_data*enc_data); +krb5_error_code krb5_rc_default (krb5_context, krb5_rcache*); +krb5_error_code krb5_rc_register_type (krb5_context, krb5_rc_ops*); +krb5_error_code krb5_rc_resolve_type (krb5_context, krb5_rcache*,char*); +krb5_error_code krb5_rc_resolve_full (krb5_context, krb5_rcache*,char*); +char* krb5_rc_get_type (krb5_context, krb5_rcache); +char* krb5_rc_default_type (krb5_context); +char* krb5_rc_default_name (krb5_context); +krb5_error_code krb5_auth_to_rep (krb5_context, krb5_tkt_authent*, krb5_donot_replay*); +krb5_error_code krb5_init_context (krb5_context*); +void krb5_free_context (krb5_context); +krb5_error_code krb5_set_default_in_tkt_ktypes (krb5_context, const krb5_enctype*); +krb5_error_code krb5_get_default_in_tkt_ktypes (krb5_context, krb5_enctype**); +krb5_error_code krb5_set_default_tgs_ktypes (krb5_context, const krb5_enctype*); +krb5_error_code krb5_get_tgs_ktypes (krb5_context, krb5_const_principal, krb5_enctype**); +krb5_error_code krb5_get_permitted_enctypes (krb5_context, krb5_enctype**); +krb5_boolean krb5_is_permitted_enctype (krb5_context, krb5_enctype); +krb5_error_code krb5_kdc_rep_decrypt_proc (krb5_context, const krb5_keyblock*, krb5_const_pointer, krb5_kdc_rep* ); +krb5_error_code krb5_decrypt_tkt_part (krb5_context, const krb5_keyblock*, krb5_ticket* ); +krb5_error_code krb5_get_cred_from_kdc (krb5_context, krb5_ccache, krb5_creds*, krb5_creds**, krb5_creds*** ); +krb5_error_code krb5_get_cred_from_kdc_validate (krb5_context, krb5_ccache, krb5_creds*, krb5_creds**, krb5_creds***); +krb5_error_code krb5_get_cred_from_kdc_renew (krb5_context, krb5_ccache, krb5_creds*, krb5_creds**, krb5_creds***); +void krb5_free_tgt_creds (krb5_context, krb5_creds**); +krb5_error_code krb5_get_credentials (krb5_context, const krb5_flags, krb5_ccache, krb5_creds*, krb5_creds**); +krb5_error_code krb5_get_credentials_validate (krb5_context, const krb5_flags, krb5_ccache, krb5_creds*, krb5_creds**); +krb5_error_code krb5_get_credentials_renew (krb5_context, const krb5_flags, krb5_ccache, krb5_creds*, krb5_creds**); +krb5_error_code krb5_get_cred_via_tkt (krb5_context, krb5_creds*, const krb5_flags, krb5_address* const*, krb5_creds*, krb5_creds**); +krb5_error_code krb5_mk_req (krb5_context, krb5_auth_context*, const krb5_flags, char*, char*, krb5_data*, krb5_ccache, krb5_data*); +krb5_error_code krb5_mk_req_extended (krb5_context, krb5_auth_context*, const krb5_flags, krb5_data*, krb5_creds*, krb5_data*); +krb5_error_code krb5_mk_rep (krb5_context, krb5_auth_context, krb5_data*); +krb5_error_code krb5_rd_rep (krb5_context, krb5_auth_context, const krb5_data*, krb5_ap_rep_enc_part**); +krb5_error_code krb5_mk_error (krb5_context, const krb5_error*, krb5_data*); +krb5_error_code krb5_rd_error (krb5_context, const krb5_data*, krb5_error**); +krb5_error_code krb5_rd_safe (krb5_context, krb5_auth_context, const krb5_data*, krb5_data*, krb5_replay_data*); +krb5_error_code krb5_rd_priv (krb5_context, krb5_auth_context, const krb5_data*, krb5_data*, krb5_replay_data*); +krb5_error_code krb5_parse_name (krb5_context, const char*, krb5_principal*); +krb5_error_code krb5_unparse_name (krb5_context, krb5_const_principal, char**); +krb5_error_code krb5_unparse_name_ext (krb5_context, krb5_const_principal, char**, int*); +krb5_error_code krb5_set_principal_realm (krb5_context, krb5_principal, const char*); +krb5_boolean krb5_address_search (krb5_context, const krb5_address*, krb5_address* const*); +krb5_boolean krb5_address_compare (krb5_context, const krb5_address*, const krb5_address*); +int krb5_address_order (krb5_context, const krb5_address*, const krb5_address*); +krb5_boolean krb5_realm_compare (krb5_context, krb5_const_principal, krb5_const_principal); +krb5_boolean krb5_principal_compare (krb5_context, krb5_const_principal, krb5_const_principal); +krb5_error_code krb5_copy_keyblock (krb5_context, const krb5_keyblock*, krb5_keyblock**); +krb5_error_code krb5_copy_keyblock_contents (krb5_context, const krb5_keyblock*, krb5_keyblock*); +krb5_error_code krb5_copy_creds (krb5_context, const krb5_creds*, krb5_creds**); +krb5_error_code krb5_copy_data (krb5_context, const krb5_data*, krb5_data**); +krb5_error_code krb5_copy_principal (krb5_context, krb5_const_principal, krb5_principal*); +krb5_error_code krb5_copy_addr (krb5_context, const krb5_address*, krb5_address**); +krb5_error_code krb5_copy_addresses (krb5_context, krb5_address* const*, krb5_address***); +krb5_error_code krb5_copy_ticket (krb5_context, const krb5_ticket*, krb5_ticket**); +krb5_error_code krb5_copy_authdata (krb5_context, krb5_authdata* const*, krb5_authdata***); +krb5_error_code krb5_copy_authenticator (krb5_context, const krb5_authenticator*, krb5_authenticator**); +krb5_error_code krb5_copy_checksum (krb5_context, const krb5_checksum*, krb5_checksum**); +void krb5_init_ets (krb5_context); +void krb5_free_ets (krb5_context); +krb5_error_code krb5_generate_subkey (krb5_context, const krb5_keyblock*, krb5_keyblock**); +krb5_error_code krb5_generate_seq_number (krb5_context, const krb5_keyblock*, krb5_int32*); +krb5_error_code krb5_get_server_rcache (krb5_context, const krb5_data*, krb5_rcache*); +krb5_error_code krb5_build_principal_va (krb5_context, krb5_principal, int, const char*, va_list); +krb5_error_code krb5_425_conv_principal (krb5_context, const char*name, const char*instance, const char*realm, krb5_principal*princ); +krb5_error_code krb5_524_conv_principal (krb5_context context, const krb5_principal princ, char*name, char*inst, char*realm); +krb5_error_code krb5_mk_chpw_req (krb5_context context, krb5_auth_context auth_context, krb5_data*ap_req, char*passwd, krb5_data*packet); +krb5_error_code krb5_rd_chpw_rep (krb5_context context, krb5_auth_context auth_context, krb5_data*packet, int*result_code, krb5_data*result_data); +krb5_error_code krb5_chpw_result_code_string (krb5_context context, int result_code, char**result_codestr); +krb5_error_code krb5_kt_register (krb5_context, krb5_kt_ops*); +krb5_error_code krb5_kt_resolve (krb5_context, const char*, krb5_keytab*); +krb5_error_code krb5_kt_default_name (krb5_context, char*, int); +krb5_error_code krb5_kt_default (krb5_context, krb5_keytab*); +krb5_error_code krb5_kt_free_entry (krb5_context, krb5_keytab_entry*); +krb5_error_code krb5_kt_remove_entry (krb5_context, krb5_keytab, krb5_keytab_entry*); +krb5_error_code krb5_kt_add_entry (krb5_context, krb5_keytab, krb5_keytab_entry*); +krb5_error_code krb5_principal2salt (krb5_context, krb5_const_principal, krb5_data*); +krb5_error_code krb5_principal2salt_norealm (krb5_context, krb5_const_principal, krb5_data*); +krb5_error_code krb5_cc_resolve (krb5_context, const char*, krb5_ccache*); +const char* krb5_cc_default_name (krb5_context); +krb5_error_code krb5_cc_set_default_name (krb5_context, const char*); +krb5_error_code krb5_cc_default (krb5_context, krb5_ccache*); +unsigned int krb5_get_notification_message (void); +krb5_error_code krb5_cc_copy_creds (krb5_context context, krb5_ccache incc, krb5_ccache outcc); +krb5_error_code krb5_check_transited_list (krb5_context, krb5_data*trans, krb5_data*realm1, krb5_data*realm2); +void krb5_free_realm_tree (krb5_context, krb5_principal*); +void krb5_free_principal (krb5_context, krb5_principal); +void krb5_free_authenticator (krb5_context, krb5_authenticator*); +void krb5_free_authenticator_contents (krb5_context, krb5_authenticator*); +void krb5_free_addresses (krb5_context, krb5_address**); +void krb5_free_address (krb5_context, krb5_address*); +void krb5_free_authdata (krb5_context, krb5_authdata**); +void krb5_free_enc_tkt_part (krb5_context, krb5_enc_tkt_part*); +void krb5_free_ticket (krb5_context, krb5_ticket*); +void krb5_free_tickets (krb5_context, krb5_ticket**); +void krb5_free_kdc_req (krb5_context, krb5_kdc_req*); +void krb5_free_kdc_rep (krb5_context, krb5_kdc_rep*); +void krb5_free_last_req (krb5_context, krb5_last_req_entry**); +void krb5_free_enc_kdc_rep_part (krb5_context, krb5_enc_kdc_rep_part*); +void krb5_free_error (krb5_context, krb5_error*); +void krb5_free_ap_req (krb5_context, krb5_ap_req*); +void krb5_free_ap_rep (krb5_context, krb5_ap_rep*); +void krb5_free_safe (krb5_context, krb5_safe*); +void krb5_free_priv (krb5_context, krb5_priv*); +void krb5_free_priv_enc_part (krb5_context, krb5_priv_enc_part*); +void krb5_free_cred (krb5_context, krb5_cred*); +void krb5_free_creds (krb5_context, krb5_creds*); +void krb5_free_cred_contents (krb5_context, krb5_creds*); +void krb5_free_cred_enc_part (krb5_context, krb5_cred_enc_part*); +void krb5_free_checksum (krb5_context, krb5_checksum*); +void krb5_free_checksum_contents (krb5_context, krb5_checksum*); +void krb5_free_keyblock (krb5_context, krb5_keyblock*); +void krb5_free_keyblock_contents (krb5_context, krb5_keyblock*); +void krb5_free_pa_data (krb5_context, krb5_pa_data**); +void krb5_free_ap_rep_enc_part (krb5_context, krb5_ap_rep_enc_part*); +void krb5_free_tkt_authent (krb5_context, krb5_tkt_authent*); +void krb5_free_pwd_data (krb5_context, krb5_pwd_data*); +void krb5_free_pwd_sequences (krb5_context, passwd_phrase_element**); +void krb5_free_data (krb5_context, krb5_data*); +void krb5_free_data_contents (krb5_context, krb5_data*); +void krb5_free_unparsed_name (krb5_context, char*); +void krb5_free_cksumtypes (krb5_context, krb5_cksumtype*); +krb5_error_code krb5_us_timeofday (krb5_context, krb5_int32*, krb5_int32*); +krb5_error_code krb5_timeofday (krb5_context, krb5_int32*); +krb5_error_code krb5_os_localaddr (krb5_context, krb5_address***); +krb5_error_code krb5_get_default_realm (krb5_context, char**); +krb5_error_code krb5_set_default_realm (krb5_context, const char*); +krb5_error_code krb5_sname_to_principal (krb5_context, const char*, const char*, krb5_int32, krb5_principal*); +krb5_error_code krb5_change_password (krb5_context context, krb5_creds*creds, char*newpw, int*result_code, krb5_data*result_code_string, krb5_data*result_string); +krb5_error_code krb5_get_profile (krb5_context, profile_t*); +krb5_error_code krb5_secure_config_files (krb5_context); +krb5_error_code krb5_send_tgs (krb5_context, const krb5_flags, const krb5_ticket_times*, const krb5_enctype*, krb5_const_principal, krb5_address* const*, krb5_authdata* const*, krb5_pa_data* const*, const krb5_data*, krb5_creds*, krb5_response*); +krb5_error_code krb5_get_in_tkt_with_password (krb5_context, const krb5_flags, krb5_address* const*, krb5_enctype*, krb5_preauthtype*, const char*, krb5_ccache, krb5_creds*, krb5_kdc_rep**); +krb5_error_code krb5_get_in_tkt_with_skey (krb5_context, const krb5_flags, krb5_address* const*, krb5_enctype*, krb5_preauthtype*, const krb5_keyblock*, krb5_ccache, krb5_creds*, krb5_kdc_rep**); +krb5_error_code krb5_get_in_tkt_with_keytab (krb5_context, const krb5_flags, krb5_address* const*, krb5_enctype*, krb5_preauthtype*, const krb5_keytab, krb5_ccache, krb5_creds*, krb5_kdc_rep**); +krb5_error_code krb5_decode_kdc_rep (krb5_context, krb5_data*, const krb5_keyblock*, krb5_kdc_rep**); +krb5_error_code krb5_rd_req (krb5_context, krb5_auth_context*, const krb5_data*, krb5_const_principal, krb5_keytab, krb5_flags*, krb5_ticket**); +krb5_error_code krb5_rd_req_decoded (krb5_context, krb5_auth_context*, const krb5_ap_req*, krb5_const_principal, krb5_keytab, krb5_flags*, krb5_ticket**); +krb5_error_code krb5_rd_req_decoded_anyflag (krb5_context, krb5_auth_context*, const krb5_ap_req*, krb5_const_principal, krb5_keytab, krb5_flags*, krb5_ticket**); +krb5_error_code krb5_kt_read_service_key (krb5_context, krb5_pointer, krb5_principal, krb5_kvno, krb5_enctype, krb5_keyblock**); +krb5_error_code krb5_mk_safe (krb5_context, krb5_auth_context, const krb5_data*, krb5_data*, krb5_replay_data*); +krb5_error_code krb5_mk_priv (krb5_context, krb5_auth_context, const krb5_data*, krb5_data*, krb5_replay_data*); +krb5_error_code krb5_cc_register (krb5_context, krb5_cc_ops*, krb5_boolean); +krb5_error_code krb5_sendauth (krb5_context, krb5_auth_context*, krb5_pointer, char*, krb5_principal, krb5_principal, krb5_flags, krb5_data*, krb5_creds*, krb5_ccache, krb5_error**, krb5_ap_rep_enc_part**, krb5_creds**); +krb5_error_code krb5_recvauth (krb5_context, krb5_auth_context*, krb5_pointer, char*, krb5_principal, krb5_int32, krb5_keytab, krb5_ticket**); +krb5_error_code krb5_walk_realm_tree (krb5_context, const krb5_data*, const krb5_data*, krb5_principal**, int); +krb5_error_code krb5_mk_ncred (krb5_context, krb5_auth_context, krb5_creds**, krb5_data**, krb5_replay_data*); +krb5_error_code krb5_mk_1cred (krb5_context, krb5_auth_context, krb5_creds*, krb5_data**, krb5_replay_data*); +krb5_error_code krb5_rd_cred (krb5_context, krb5_auth_context, krb5_data*, krb5_creds***, krb5_replay_data*); +krb5_error_code krb5_fwd_tgt_creds (krb5_context, krb5_auth_context, char*, krb5_principal, krb5_principal, krb5_ccache, int forwardable, krb5_data*); +krb5_error_code krb5_auth_con_init (krb5_context, krb5_auth_context*); +krb5_error_code krb5_auth_con_free (krb5_context, krb5_auth_context); +krb5_error_code krb5_auth_con_setflags (krb5_context, krb5_auth_context, krb5_int32); +krb5_error_code krb5_auth_con_getflags (krb5_context, krb5_auth_context, krb5_int32*); +krb5_error_code krb5_auth_con_setaddrs (krb5_context, krb5_auth_context, krb5_address*, krb5_address*); +krb5_error_code krb5_auth_con_getaddrs (krb5_context, krb5_auth_context, krb5_address**, krb5_address**); +krb5_error_code krb5_auth_con_setports (krb5_context, krb5_auth_context, krb5_address*, krb5_address*); +krb5_error_code krb5_auth_con_setuseruserkey (krb5_context, krb5_auth_context, krb5_keyblock*); +krb5_error_code krb5_auth_con_getkey (krb5_context, krb5_auth_context, krb5_keyblock**); +krb5_error_code krb5_auth_con_getlocalsubkey (krb5_context, krb5_auth_context, krb5_keyblock**); +krb5_error_code krb5_auth_con_set_req_cksumtype (krb5_context, krb5_auth_context, krb5_cksumtype); +krb5_error_code krb5_auth_con_set_safe_cksumtype (krb5_context, krb5_auth_context, krb5_cksumtype); +krb5_error_code krb5_auth_con_getcksumtype (krb5_context, krb5_auth_context, krb5_cksumtype*); +krb5_error_code krb5_auth_con_getlocalseqnumber (krb5_context, krb5_auth_context, krb5_int32*); +krb5_error_code krb5_auth_con_getremoteseqnumber (krb5_context, krb5_auth_context, krb5_int32*); +krb5_error_code krb5_auth_con_initivector (krb5_context, krb5_auth_context); +krb5_error_code krb5_auth_con_setivector (krb5_context, krb5_auth_context, krb5_pointer); +krb5_error_code krb5_auth_con_getivector (krb5_context, krb5_auth_context, krb5_pointer*); +krb5_error_code krb5_auth_con_setrcache (krb5_context, krb5_auth_context, krb5_rcache); +krb5_error_code krb5_auth_con_getrcache (krb5_context, krb5_auth_context, krb5_rcache*); +krb5_error_code krb5_auth_con_getauthenticator (krb5_context, krb5_auth_context, krb5_authenticator**); +krb5_error_code krb5_auth_con_getremotesubkey (krb5_context, krb5_auth_context, krb5_keyblock**); +krb5_error_code krb5_read_password (krb5_context, const char*, const char*, char*, int*); +krb5_error_code krb5_aname_to_localname (krb5_context, krb5_const_principal, const int, char*); +krb5_error_code krb5_get_host_realm (krb5_context, const char*, char***); +krb5_error_code krb5_free_host_realm (krb5_context, char* const*); +krb5_error_code krb5_get_realm_domain (krb5_context, const char*, char**); +krb5_boolean krb5_kuserok (krb5_context, krb5_principal, const char*); +krb5_error_code krb5_auth_con_genaddrs (krb5_context, krb5_auth_context, int, int); +krb5_error_code krb5_gen_portaddr (krb5_context, const krb5_address*, krb5_const_pointer, krb5_address**); +krb5_error_code krb5_make_fulladdr (krb5_context, krb5_address*, krb5_address*, krb5_address*); +krb5_error_code krb5_os_hostaddr (krb5_context, const char*, krb5_address***); +krb5_error_code krb5_set_real_time (krb5_context, krb5_int32, krb5_int32); +krb5_error_code krb5_set_debugging_time (krb5_context, krb5_int32, krb5_int32); +krb5_error_code krb5_use_natural_time (krb5_context); +krb5_error_code krb5_get_time_offsets (krb5_context, krb5_int32*, krb5_int32*); +krb5_error_code krb5_set_time_offsets (krb5_context, krb5_int32, krb5_int32); +krb5_error_code krb5_string_to_enctype (char*, krb5_enctype*); +krb5_error_code krb5_string_to_salttype (char*, krb5_int32*); +krb5_error_code krb5_string_to_cksumtype (char*, krb5_cksumtype*); +krb5_error_code krb5_string_to_timestamp (char*, krb5_timestamp*); +krb5_error_code krb5_string_to_deltat (char*, krb5_deltat*); +krb5_error_code krb5_enctype_to_string (krb5_enctype, char*, size_t); +krb5_error_code krb5_salttype_to_string (krb5_int32, char*, size_t); +krb5_error_code krb5_cksumtype_to_string (krb5_cksumtype, char*, size_t); +krb5_error_code krb5_timestamp_to_string (krb5_timestamp, char*, size_t); +krb5_error_code krb5_timestamp_to_sfstring (krb5_timestamp, char*, size_t, char*); +krb5_error_code krb5_deltat_to_string (krb5_deltat, char*, size_t); +krb5_error_code krb5_prompter_posix (krb5_context context, void*data, const char*name, const char*banner, int num_prompts, krb5_prompt prompts[]); +void krb5_get_init_creds_opt_init (krb5_get_init_creds_opt*opt); +void krb5_get_init_creds_opt_set_tkt_life (krb5_get_init_creds_opt*opt, krb5_deltat tkt_life); +void krb5_get_init_creds_opt_set_renew_life (krb5_get_init_creds_opt*opt, krb5_deltat renew_life); +void krb5_get_init_creds_opt_set_forwardable (krb5_get_init_creds_opt*opt, int forwardable); +void krb5_get_init_creds_opt_set_proxiable (krb5_get_init_creds_opt*opt, int proxiable); +void krb5_get_init_creds_opt_set_etype_list (krb5_get_init_creds_opt*opt, krb5_enctype*etype_list, int etype_list_length); +void krb5_get_init_creds_opt_set_address_list (krb5_get_init_creds_opt*opt, krb5_address**addresses); +void krb5_get_init_creds_opt_set_preauth_list (krb5_get_init_creds_opt*opt, krb5_preauthtype*preauth_list, int preauth_list_length); +void krb5_get_init_creds_opt_set_salt (krb5_get_init_creds_opt*opt, krb5_data*salt); +krb5_error_code krb5_get_init_creds_password (krb5_context context, krb5_creds*creds, krb5_principal client, char*password, krb5_prompter_fct prompter, void*data, krb5_deltat start_time, char*in_tkt_service, krb5_get_init_creds_opt*options); +krb5_error_code krb5_get_init_creds_keytab (krb5_context context, krb5_creds*creds, krb5_principal client, krb5_keytab arg_keytab, krb5_deltat start_time, char*in_tkt_service, krb5_get_init_creds_opt*options); +void krb5_verify_init_creds_opt_init (krb5_verify_init_creds_opt*options); +void krb5_verify_init_creds_opt_set_ap_req_nofail (krb5_verify_init_creds_opt*options, int ap_req_nofail); +krb5_error_code krb5_verify_init_creds (krb5_context context, krb5_creds*creds, krb5_principal ap_req_server, krb5_keytab ap_req_keytab, krb5_ccache*ccache, krb5_verify_init_creds_opt*options); +krb5_error_code krb5_get_validated_creds (krb5_context context, krb5_creds*creds, krb5_principal client, krb5_ccache ccache, char*in_tkt_service); +krb5_error_code krb5_get_renewed_creds (krb5_context context, krb5_creds*creds, krb5_principal client, krb5_ccache ccache, char*in_tkt_service); +krb5_error_code krb5_realm_iterator_create (krb5_context context, void**iter_p); +krb5_error_code krb5_realm_iterator (krb5_context context, void**iter_p, char**ret_realm); +void krb5_realm_iterator_free (krb5_context context, void**iter_p); +void krb5_free_realm_string (krb5_context context, char*str); -- 2.26.2