diff options
author | Sam Hartman <hartmans@mit.edu> | 2005-05-20 02:05:24 +0000 |
---|---|---|
committer | Sam Hartman <hartmans@mit.edu> | 2005-05-20 02:05:24 +0000 |
commit | 9f6b2ceb0638e95a76242cbe6f7d02729be471ec (patch) | |
tree | 9a0e0525095a19abe3611c3c8b300fb5b10517ce /src/lib/krb5/krb | |
parent | f2f53802ee47d3e805953b27a933da8ebb7b20eb (diff) | |
download | krb5-9f6b2ceb0638e95a76242cbe6f7d02729be471ec.zip krb5-9f6b2ceb0638e95a76242cbe6f7d02729be471ec.tar.gz krb5-9f6b2ceb0638e95a76242cbe6f7d02729be471ec.tar.bz2 |
Implement RFC 3961 PRF
Add krb5_c_prf, a function that implements the RFC 3961 PRF.
As part of this change, the krb5_init_keyblock and krb5 free routines
move to libk5crypto. Public stubs remain in libkrb5, but the actual
implementation is an internal interface in libk5crypto
ticket: new
Tags: enhancement
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17219 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/krb')
-rw-r--r-- | src/lib/krb5/krb/ChangeLog | 6 | ||||
-rw-r--r-- | src/lib/krb5/krb/deltat.c | 44 | ||||
-rw-r--r-- | src/lib/krb5/krb/init_keyblock.c | 22 | ||||
-rw-r--r-- | src/lib/krb5/krb/kfree.c | 9 |
4 files changed, 35 insertions, 46 deletions
diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 26ae8fe..01f9e49 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +2005-05-19 Sam Hartman <hartmans@mit.edu> + + * kfree.c (krb5_free_keyblock_contents krb5_free_keyblock): Make + stubs into libk5crypto so that libk5crypto can call these. + * init_keyblock.c (krb5_init_keyblock): As above. + 2005-04024 Jeffrey Altman <jaltman@mit.edu> * get_creds.c: diff --git a/src/lib/krb5/krb/deltat.c b/src/lib/krb5/krb/deltat.c index 770234d..2541591 100644 --- a/src/lib/krb5/krb/deltat.c +++ b/src/lib/krb5/krb/deltat.c @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 1.875d. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 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 @@ -187,6 +187,13 @@ typedef union YYSTYPE { int val; } YYSTYPE; #if ! defined (yyoverflow) || YYERROR_VERBOSE +# ifndef YYFREE +# define YYFREE free +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# endif + /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA @@ -211,8 +218,8 @@ typedef union YYSTYPE { int val; } YYSTYPE; # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ @@ -224,7 +231,7 @@ typedef union YYSTYPE { int val; } YYSTYPE; /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + short int yyss; YYSTYPE yyvs; }; @@ -234,7 +241,7 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do @@ -276,7 +283,7 @@ union yyalloc #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else - typedef short yysigned_char; + typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ @@ -378,7 +385,7 @@ static const char *const yytname[] = # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 45, 58, 100, 104, 109, 115, 261 @@ -580,12 +587,12 @@ do { \ #if defined (__STDC__) || defined (__cplusplus) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + short int *bottom; + short int *top; #endif { YYFPRINTF (stderr, "Stack now"); @@ -852,9 +859,9 @@ int yynerrs; to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; @@ -891,6 +898,7 @@ int yynerrs; yyssp = yyss; yyvsp = yyvs; + goto yysetstate; /*------------------------------------------------------------. @@ -916,7 +924,7 @@ int yynerrs; these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the @@ -944,7 +952,7 @@ int yynerrs; yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) @@ -1151,8 +1159,8 @@ yyreduce: } -/* Line 993 of yacc.c. */ -#line 1156 "deltat.c" +/* Line 1010 of yacc.c. */ +#line 1164 "deltat.c" yyvsp -= yylen; yyssp -= yylen; diff --git a/src/lib/krb5/krb/init_keyblock.c b/src/lib/krb5/krb/init_keyblock.c index a6feeea..3be842a 100644 --- a/src/lib/krb5/krb/init_keyblock.c +++ b/src/lib/krb5/krb/init_keyblock.c @@ -37,25 +37,5 @@ krb5_error_code KRB5_CALLCONV krb5_init_keyblock (krb5_context context, krb5_enctype enctype, size_t length, krb5_keyblock **out) { - krb5_keyblock *kb; - kb = malloc (sizeof(krb5_keyblock)); - assert (out); - *out = NULL; - if (!kb) { - return ENOMEM; - } - kb->magic = KV5M_KEYBLOCK; - kb->enctype = enctype; - kb->length = length; - if(length) { - kb->contents = malloc (length); - if(!kb->contents) { - free (kb); - return ENOMEM; - } - } else { - kb->contents = NULL; - } - *out = kb; - return 0; + return krb5int_c_init_keyblock (context, enctype, length, out); } diff --git a/src/lib/krb5/krb/kfree.c b/src/lib/krb5/krb/kfree.c index 4700439..39bb1f2 100644 --- a/src/lib/krb5/krb/kfree.c +++ b/src/lib/krb5/krb/kfree.c @@ -340,18 +340,13 @@ krb5_free_kdc_req(krb5_context context, krb5_kdc_req *val) void KRB5_CALLCONV krb5_free_keyblock_contents(krb5_context context, register krb5_keyblock *key) { - if (key->contents) { - memset(key->contents, 0, key->length); - krb5_xfree(key->contents); - key->contents = 0; - } + krb5int_c_free_keyblock_contents (context, key); } void KRB5_CALLCONV krb5_free_keyblock(krb5_context context, register krb5_keyblock *val) { - krb5_free_keyblock_contents(context, val); - krb5_xfree(val); + krb5int_c_free_keyblock (context, val); } |