linux/net/sctp/auth.c
<<
9.4" /spapti /formti a 9.4" href="../linux+v3 v310/net/sctp/auth.c">9.4" img src="../.static/gfx/right.png" alt=">>">9. /spapti9. spap class="lxr_search">9.4"9.4" input typn vhidden" namn vnavtarget" ption v">9.4" input typn vtext" namn vsearch" id vsearch">9.4" butt Search9.4" Prefsi /a>9. /spapti4" /divti4" form ac9. input typn vhidden" namn vajax_lookup" id vajax_lookup" ption v">94" /formti94" div class="headingbott m">i div id vfile_contents"t
   1 /a> spap class="comment">/* SCTP kernel implementa   2 /a> spap class="comment"> * (C) Copyright 2007 Hewlett-Packard Development Compapy, L.P. /spapti   3 /a> spap class="comment"> * /spapti   4 /a> spap class="comment"> * This file is part of the SCTP kernel implementa   5 /a> spap class="comment"> * /spapti   6 /a> spap class="comment"> * This SCTP implementa   7 /a> spap class="comment"> * you cap redistribute it and/or modify it under the terms of /spapti   8 /a> spap class="comment"> * the GNU General Public License as published by /spapti   9 /a> spap class="comment"> * the Free Software Founda  .18.a> spap class="comment"> * apy later vers/op. /spapti  11 /a> spap class="comment"> * /spapti  12 /a> spap class="comment"> * This SCTP implementa  13 /a> spap class="comment"> * will be useful, but WITHOUT ANY WARRANTY; without even the implied /spapti  14 /a> spap class="comment"> *                 ************************ /spapti  15 /a> spap class="comment"> * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. /spapti  16 /a> spap class="comment"> * See the GNU General Public License for more details. /spapti  17 /a> spap class="comment"> * /spapti  18 /a> spap class="comment"> * You should have received a copy of the GNU General Public License /spapti  19 /a> spap class="comment"> * along with GNU CC; see the file COPYING.  If not, write to /spapti  218.a> spap class="comment"> * the Free Software Founda  21 /a> spap class="comment"> * Bostop, MA 02111-1307, USA. /spapti  22 /a> spap class="comment"> * /spapti  23 /a> spap class="comment"> * Please send apy bug reports or fixes you make to the /spapti  24 /a> spap class="comment"> * email address(es): /spapti  25 /a> spap class="comment"> *    lksctp developers <lksctp-developers@lists.sourceforge.net> /spapti  26 /a> spap class="comment"> * /spapti  27 /a> spap class="comment"> * Or submit a bug report through the following website: /spapti  28 /a> spap class="comment"> * 
  http://www.sf.net/projects/lksctp /spapti  29 /a> spap class="comment"> * /spapti  318.a> spap class="comment"> * Written or modified by: /spapti  31 /a> spap class="comment"> *   Vlad Yasevich     <vladislav.yasevich@hp.com> /spapti  32 /a> spap class="comment"> * /spapti  33 /a> spap class="comment"> * Apy bugs reported given to us we will try to fix... apy fixes shared will /spapti  34 /a> spap class="comment"> * be incorporated into the next SCTP release. /spapti  35 /a> spap class="comment"> */ /spapti  36 /a>i  37 /a>#include <linux/slab.h /a>>i  38 /a>#include <linux/typns.h /a>>i  39 /a>#include <linux/crypto.h /a>>i  40 /a>#include <linux/scatterlist.h /a>>i  41 /a>#include <net/sctp/sctp.h /a>>i  42 /a>#include <net/sctp/auth.h /a>>i  43 /a>i  44 /a>static struct  a href="+code=sctp_hmac" class="sref">sctp_hmac /a>  a href="+code=sctp_hmac_list" class="sref">sctp_hmac_list /a>[ a href="+code=SCTP_AUTH_NUM_HMACS" class="sref">SCTP_AUTH_NUM_HMACS /a>] = {i  45 /a>        {i  46 /a>                 spap class="comment">/* id 0 is reserved.  as all 0 */ /spapti  47 /a>                . a href="+code=hmac_id" class="sref">hmac_id /a> =  a href="+code=SCTP_AUTH_HMAC_ID_RESERVED_0" class="sref">SCTP_AUTH_HMAC_ID_RESERVED_0 /a>,i  48 /a>        },i  49 /a>        {i  50 /a>                . a href="+code=hmac_id" class="sref">hmac_id /a> =  a href="+code=SCTP_AUTH_HMAC_ID_SHA1" class="sref">SCTP_AUTH_HMAC_ID_SHA1 /a>,i  51 /a>                . a href="+code=hmac_namn" class="sref">hmac_namn /a>= spap class="string">"hmac(sha1)" /spapt,i  52 /a>                . a href="+code=hmac_len" class="sref">hmac_len /a> =  a href="+code=SCTP_SHA1_SIG_SIZE" class="sref">SCTP_SHA1_SIG_SIZE /a>,i  53 /a>        },i  54 /a>        {i  55 /a>                 spap class="comment">/* id 2 is reserved as well */ /spapti  56 /a>                . a href="+code=hmac_id" class="sref">hmac_id /a> =  a href="+code=SCTP_AUTH_HMAC_ID_RESERVED_2" class="sref">SCTP_AUTH_HMAC_ID_RESERVED_2 /a>,i  57 /a>        },i  58 /a>#if  a href="+code=defined" class="sref">defined /a> ( a href="+code=CONFIG_CRYPTO_SHA256" class="sref">CONFIG_CRYPTO_SHA256 /a>) ||  a href="+code=defined" class="sref">defined /a> ( a href="+code=CONFIG_CRYPTO_SHA256_MODULE" class="sref">CONFIG_CRYPTO_SHA256_MODULE /a>)i  59 /a>        {i  60 /a>                . a href="+code=hmac_id" class="sref">hmac_id /a> =  a href="+code=SCTP_AUTH_HMAC_ID_SHA256" class="sref">SCTP_AUTH_HMAC_ID_SHA256 /a>,i  61 /a>                . a href="+code=hmac_namn" class="sref">hmac_namn /a>= spap class="string">"hmac(sha256)" /spapt,i  62 /a>                . a href="+code=hmac_len" class="sref">hmac_len /a> =  a href="+code=SCTP_SHA256_SIG_SIZE" class="sref">SCTP_SHA256_SIG_SIZE /a>,i  63 /a>        }i  64 /a>#endifi  65 /a>};i  66 /a>i  67 /a>i  68 /a>void  a href="+code=sctp_auth_key_put" class="sref">sctp_auth_key_put /a>(struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=key" class="sref">key /a>)i  69 /a>{i  70 /a>        if (! a href="+code=key" class="sref">key /a>)i  71 /a>                return;i  72 /a>i  73 /a>        if ( a href="+code=atomic_dec_and_test" class="sref">atomic_dec_and_test /a>(& a href="+code=key" class="sref">key /a>-> a href="+code=refcnt" class="sref">refcnt /a>)) {i  74 /a>                 a href="+code=kfree" class="sref">kfree /a>( a href="+code=key" class="sref">key /a>);i  75 /a>                 a href="+code=SCTP_DBG_OBJCNT_DEC" class="sref">SCTP_DBG_OBJCNT_DEC /a>( a href="+code=keys" class="sref">keys /a>);i  76 /a>        }i  77 /a>}i  78 /a>i  79 /a> spap class="comment">/* Create a new key structure of a given length */ /spapti  80 /a>static struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=sctp_auth_create_key" class="sref">sctp_auth_create_key /a>( a href="+code=__u32" class="sref">__u32 /a>  a href="+code=key_len" class="sref">key_len /a>,  a href="+code=gfp_t" class="sref">gfp_t /a>  a href="+code=gfp" class="sref">gfp /a>)i  81 /a>{i  82 /a>        struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=key" class="sref">key /a>;i  83 /a>i  84 /a>         spap class="comment">/* Verify that we are not going to overflow INT_MAX */ /spapti  85 /a>        if ( a href="+code=key_len" class="sref">key_len /a> > ( a href="+code=INT_MAX" class="sref">INT_MAX /a> - sizeof(struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a>)))i  86 /a>                return  a href="+code=NULL" class="sref">NULL /a>;i  87 /a>i  88 /a>         spap class="comment">/* Allocate the shared key */ /spapti  89 /a>         a href="+code=key" class="sref">key /a> =  a href="+code=kmalloc" class="sref">kmalloc /a>(sizeof(struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a>) +  a href="+code=key_len" class="sref">key_len /a>,  a href="+code=gfp" class="sref">gfp /a>);i  90 /a>        if (! a href="+code=key" class="sref">key /a>)i  91 /a>                return  a href="+code=NULL" class="sref">NULL /a>;i  92 /a>i  93 /a>         a href="+code=key" class="sref">key /a>-> a href="+code=len" class="sref">len /a> =  a href="+code=key_len" class="sref">key_len /a>;i  94 /a>         a href="+code=atomic_set" class="sref">atomic_set /a>(& a href="+code=key" class="sref">key /a>-> a href="+code=refcnt" class="sref">refcnt /a>, 1);i  95 /a>         a href="+code=SCTP_DBG_OBJCNT_INC" class="sref">SCTP_DBG_OBJCNT_INC /a>( a href="+code=keys" class="sref">keys /a>);i  96 /a>i  97 /a>        return  a href="+code=key" class="sref">key /a>;i  98 /a>}i  99 /a>i 100 /a> spap class="comment">/* Create a new shared key container with a give key id */ /spapti 101 /a>struct  a href="+code=sctp_shared_key" class="sref">sctp_shared_key /a> * a href="+code=sctp_auth_shkey_create" class="sref">sctp_auth_shkey_create /a>( a href="+code=__u16" class="sref">__u16 /a>  a href="+code=key_id" class="sref">key_id /a>,  a href="+code=gfp_t" class="sref">gfp_t /a>  a href="+code=gfp" class="sref">gfp /a>)i 102 /a>{i 103 /a>        struct  a href="+code=sctp_shared_key" class="sref">sctp_shared_key /a> * a href="+code=new" class="sref">new /a>;i 104 /a>i 105 /a>         spap class="comment">/* Allocate the shared key container */ /spapti 106 /a>         a href="+code=new" class="sref">new /a> =  a href="+code=kzalloc" class="sref">kzalloc /a>(sizeof(struct  a href="+code=sctp_shared_key" class="sref">sctp_shared_key /a>),  a href="+code=gfp" class="sref">gfp /a>);i 107 /a>        if (! a href="+code=new" class="sref">new /a>)i 108 /a>                return  a href="+code=NULL" class="sref">NULL /a>;i 109 /a>i 110 /a>         a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD /a>(& a href="+code=new" class="sref">new /a>-> a href="+code=key_list" class="sref">key_list /a>);i 111 /a>         a href="+code=new" class="sref">new /a>-> a href="+code=key_id" class="sref">key_id /a> =  a href="+code=key_id" class="sref">key_id /a>;i 112 /a>i 113 /a>        return  a href="+code=new" class="sref">new /a>;i 114 /a>}i 115 /a>i 116 /a> spap class="comment">/* Free the shared key structure */ /spapti 117 /a>static void  a href="+code=sctp_auth_shkey_free" class="sref">sctp_auth_shkey_free /a>(struct  a href="+code=sctp_shared_key" class="sref">sctp_shared_key /a> * a href="+code=sh_key" class="sref">sh_key /a>)i 118 /a>{i 119 /a>         a href="+code=BUG_ON" class="sref">BUG_ON /a>(! a href="+code=list_empty" class="sref">list_empty /a>(& a href="+code=sh_key" class="sref">sh_key /a>-> a href="+code=key_list" class="sref">key_list /a>));i 120 /a>         a href="+code=sctp_auth_key_put" class="sref">sctp_auth_key_put /a>( a href="+code=sh_key" class="sref">sh_key /a>-> a href="+code=key" class="sref">key /a>);i 121 /a>         a href="+code=sh_key" class="sref">sh_key /a>-> a href="+code=key" class="sref">key /a> =  a href="+code=NULL" class="sref">NULL /a>;i 122 /a>         a href="+code=kfree" class="sref">kfree /a>( a href="+code=sh_key" class="sref">sh_key /a>);i 123 /a>}i 124 /a>i 125 /a> spap class="comment">/* Destroy the entire key list.  This is done during the /spapti 126 /a> spap class="comment"> * assoc/op and endpoint free process. /spapti 127 /a> spap class="comment"> */ /spapti 128 /a>void  a href="+code=sctp_auth_destroy_OBJCNT_INC" class="sctp_auth_destroy_OBJCshared_key" class="sref">schref=head" class="sref">list_head /a> * a href="+code=keys" class="sref">keys /a>)i 129 /a>{i 130 /a>        struct  a href="+code=sctp_shared_key" class="sref">sctp_shared_key /a> * a href="+code=ep_key" class="sref">ep_key /a>;i 131 /a>        struct  a href="+code=sctp_shared_key" class="sref">sctp_shared_key /a> * a href="+code=tmp" class="sref">tmp /a>;i 132 /a>i 133 /a>        if ( a href="+code=list_empty" class="sref">list_empty /a>( a href="+code=keys" class="sref">keys /a>))i 134 /a>                return;i 135 /a>i 136 /a>         a href="+code=key_for_each_safe" class="sref">key_for_each_safe /a>( a href="+code=ep_key" class="sref">ep_key /a>,  a href="+code=tmp" class="sref">tmp /a>,  a href="+code=keys" class="sref">keys /a>) {i 137 /a>                 a href="+code=list_del_init" class="sref">list_del_init /a>(& a href="+code=ep_key" class="sref">ep_key /a>-> a href="+code=key_list" class="sref">key_list /a>);i 138 /a>                 a href="+code=sctp_auth_shkey_free" class="sref">sctp_auth_shkey_free /a>( a href="+code=ep_key" class="sref">ep_key /a>);i 139 /a>        }i 140 /a>}i 141 /a>i 142 /a> spap class="comment">/* Compare two byte vectors as numbers.  Return ptions /spapti 143 /a> spap class="comment"> * are: /spapti 144 /a> spap class="comment"> *        0 - vectors are equal /spapti 145 /a> spap class="comment"> *      < 0 - vector 1 is smaller thap vector2 /spapti 146 /a> spap class="comment"> *      > 0 - vector 1 is greater thap vector2 /spapti 147 /a> spap class="comment"> * /spapti 148 /a> spap class="comment"> * Algorithm is: /spapti 149 /a> spap class="comment"> *      This is performed by selecting the numerically smaller key vector... /spapti 1518.a> spap class="comment"> *      If the key vectors are equal as numbers but differ in length ... /spapti 151 /a> spap class="comment"> *      the shorter vector is considered smaller /spapti 152 /a> spap class="comment"> * /spapti 153 /a> spap class="comment"> * Examples (with small ptions): /spapti 154 /a> spap class="comment"> *      000123456789 > 123456789 (first number is longer) /spapti 155 /a> spap class="comment"> *      000123456789 < 234567891 (second number is larger numerically) /spapti 156 /a> spap class="comment"> *      123456789 > 2345678      (first number is both larger & longer) /spapti 157 /a> spap class="comment"> */ /spapti 158 /a>static int  a href="+code=sctp_auth_compare_vectors" class="sref">sctp_auth_compare_vectors /a>(struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=vector1" class="sref">vector1 /a>,i 159 /a>                              struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=vector2" class="sref">vector2 /a>)i 160 /a>{i 161 /a>        int  a href="+code=diff" class="sref">diff /a>;i 162 /a>        int  a href="+code=i" class="sref">i /a>;i 163 /a>        const  a href="+code=__u8" class="sref">__u8 /a> * a href="+code=longer" class="sref">longer /a>;i 164 /a>i 165 /a>         a href="+code=diff" class="sref">diff /a> =  a href="+code=vector1" class="sref">vector1 /a>-> a href="+code=len" class="sref">len /a> -  a href="+code=vector2" class="sref">vector2 /a>-> a href="+code=len" class="sref">len /a>;i 166 /a>        if ( a href="+code=diff" class="sref">diff /a>) {i 167 /a>                 a href="+code=longer" class="sref">longer /a> = ( a href="+code=diff" class="sref">diff /a> > 0) ?  a href="+code=vector1" class="sref">vector1 /a>-> a href="+code=data" class="sref">data /a> :  a href="+code=vector2" class="sref">vector2 /a>-> a href="+code=data" class="sref">data /a>;i 168 /a>i 169 /a>                 spap class="comment">/* Check to see if the longer number is /spapti 1718.a> spap class="comment">                 * lead-zero padded.  If it is not, it /spapti 171 /a> spap class="comment">                 * is automatically larger numerically. /spapti 172 /a> spap class="comment">                 */ /spapti 173 /a>                for ( a href="+code=i" class="sref">i /a> = 0;  a href="+code=i" class="sref">i /a> <  a href="+code=abs" class="sref">abs /a>( a href="+code=diff" class="sref">diff /a>);  a href="+code=i" class="sref">i /a>++ ) {i 174 /a>                        if ( a href="+code=longer" class="sref">longer /a>[ a href="+code=i" class="sref">i /a>] != 0)i 175 /a>                                return  a href="+code=diff" class="sref">diff /a>;i 176 /a>                }i 177 /a>        }i 178 /a>i 179 /a>         spap class="comment">/* lengths are the samn, compare numbers */ /spapti 180 /a>        return  a href="+code=memcmp" class="sref">memcmp /a>( a href="+code=vector1" class="sref">vector1 /a>-> a href="+code=data" class="sref">data /a>,  a href="+code=vector2" class="sref">vector2 /a>-> a href="+code=data" class="sref">data /a>,  a href="+code=vector1" class="sref">vector1 /a>-> a href="+code=len" class="sref">len /a>);i 181 /a>}i 182 /a>i 183 /a> spap class="comment">/* /spapti 184 /a> spap class="comment"> * Create a key vector as described in SCTP-AUTH, Sec 185 /a> spap class="comment"> *    The RANDOM paramnter, the CHUNKS paramnter and the HMAC-ALGO 2spapti 186 /a> spap class="comment"> *    paramnter sent by each endpoint are concatenated as byte vectors. /spapti 187 /a> spap class="comment"> *    These paramnters include the paramnter typn, paramnter length, and /spapti 188 /a> spap class="comment"> * 
  the paramnter ption, but padding is omitted; all padding MUST be /spapti 189 /a> spap class="comment"> *    removed from this concatenat/op before proceeding with further /spapti 1918.a> spap class="comment"> *    computa 191 /a> spap class="comment"> *    omitted from the concatenat/op process.  The resulting two vectors /spapti 192 /a> spap class="comment"> *    are called the two key vectors. /spapti 193 /a> spap class="comment"> */ /spapti 194 /a>static struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=sctp_auth_make_key_vector" class="sref">sctp_auth_make_key_vector /a>(i 195 /a>                         a href="+code=sctp_random_param_t" class="sref">sctp_random_param_t /a> * a href="+code=random" class="sref">random /a>,i 196 /a>                         a href="+code=sctp_chunks_param_t" class="sref">sctp_chunks_param_t /a> * a href="+code=chunks" class="sref">chunks /a>,i 197 /a>                         a href="+code=sctp_hmac_algo_param_t" class="sref">sctp_hmac_algo_param_t /a> * a href="+code=hmacs" class="sref">hmacs /a>,i 198 /a>                         a href="+code=gfp_t" class="sref">gfp_t /a>  a href="+code=gfp" class="sref">gfp /a>)i 199 /a>{i 200 /a>        struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=new" class="sref">new /a>;i 201 /a>         a href="+code=__u32" class="sref">__u32 /a>    a href="+code=len" class="sref">len /a>;i 202 /a>         a href="+code=__u32" class="sref">__u32 /a>    a href="+code=offset" class="sref">offset /a> = 0;i 203 /a>i 204 /a>         a href="+code=len" class="sref">len /a> =  a href="+code=ntohs" class="sref">ntohs /a>( a href="+code=random" class="sref">random /a>-> a href="+code=param_hdr" class="sref">param_hdr /a>. a href="+code=length" class="sref">length /a>) +  a href="+code=ntohs" class="sref">ntohs /a>( a href="+code=hmacs" class="sref">hmacs /a>-> a href="+code=param_hdr" class="sref">param_hdr /a>. a href="+code=length" class="sref">length /a>);i 205 /a>        if ( a href="+code=chunks" class="sref">chunks /a>)i 206 /a>                 a href="+code=len" class="sref">len /a> +=  a href="+code=ntohs" class="sref">ntohs /a>( a href="+code=chunks" class="sref">chunks /a>-> a href="+code=param_hdr" class="sref">param_hdr /a>. a href="+code=length" class="sref">length /a>);i 207 /a>i 208 /a>         a href="+code=new" class="sref">new /a> =  a href="+code=kmalloc" class="sref">kmalloc /a>(sizeof(struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a>) +  a href="+code=len" class="sref">len /a>,  a href="+code=gfp" class="sref">gfp /a>);i 209 /a>        if (! a href="+code=new" class="sref">new /a>)i 210 /a>                return  a href="+code=NULL" class="sref">NULL /a>;i 211 /a>i 212 /a>         a href="+code=new" class="sref">new /a>-> a href="+code=len" class="sref">len /a> =  a href="+code=len" class="sref">len /a>;i 213 /a>i 214 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=new" class="sref">new /a>-> a href="+code=data" class="sref">data /a>,  a href="+code=random" class="sref">random /a>,  a href="+code=ntohs" class="sref">ntohs /a>( a href="+code=random" class="sref">random /a>-> a href="+code=param_hdr" class="sref">param_hdr /a>. a href="+code=length" class="sref">length /a>));i 215 /a>         a href="+code=offset" class="sref">offset /a> +=  a href="+code=ntohs" class="sref">ntohs /a>( a href="+code=random" class="sref">random /a>-> a href="+code=param_hdr" class="sref">param_hdr /a>. a href="+code=length" class="sref">length /a>);i 216 /a>i 217 /a>        if ( a href="+code=chunks" class="sref">chunks /a>) {i 218 /a>                 a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=new" class="sref">new /a>-> a href="+code=data" class="sref">data /a> +  a href="+code=offset" class="sref">offset /a>,  a href="+code=chunks" class="sref">chunks /a>,i 219 /a>                         a href="+code=ntohs" class="sref">ntohs /a>( a href="+code=chunks" class="sref">chunks /a>-> a href="+code=param_hdr" class="sref">param_hdr /a>. a href="+code=length" class="sref">length /a>));i 220 /a>                 a href="+code=offset" class="sref">offset /a> +=  a href="+code=ntohs" class="sref">ntohs /a>( a href="+code=chunks" class="sref">chunks /a>-> a href="+code=param_hdr" class="sref">param_hdr /a>. a href="+code=length" class="sref">length /a>);i 221 /a>        }i 222 /a>i 223 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=new" class="sref">new /a>-> a href="+code=data" class="sref">data /a> +  a href="+code=offset" class="sref">offset /a>,  a href="+code=hmacs" class="sref">hmacs /a>,  a href="+code=ntohs" class="sref">ntohs /a>( a href="+code=hmacs" class="sref">hmacs /a>-> a href="+code=param_hdr" class="sref">param_hdr /a>. a href="+code=length" class="sref">length /a>));i 224 /a>i 225 /a>        return  a href="+code=new" class="sref">new /a>;i 226 /a>}i 227 /a>i 228 /a>i 229 /a> spap class="comment">/* Make a key vector based op our local paramnters */ /spapti 230 /a>static struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=sctp_auth_make_local_vector" class="sref">sctp_auth_make_local_vector /a>(i 231 /a>                                    const struct  a href="+code=sctp_assoc/at/op" class="sref">sctp_assoc/at/op /a> * a href="+code=asoc" class="sref">asoc /a>,i 232 /a>                                     a href="+code=gfp_t" class="sref">gfp_t /a>  a href="+code=gfp" class="sref">gfp /a>)i 233 /a>{i 234 /a>        return  a href="+code=sctp_auth_make_key_vector" class="sref">sctp_auth_make_key_vector /a>(i 235 /a>                                    ( a href="+code=sctp_random_param_t" class="sref">sctp_random_param_t /a>*) a href="+code=asoc" class="sref">asoc /a>-> a href="+code=c" class="sref">c /a>. a href="+code=auth_random" class="sref">auth_random /a>,i 236 /a>                                    ( a href="+code=sctp_chunks_param_t" class="sref">sctp_chunks_param_t /a>*) a href="+code=asoc" class="sref">asoc /a>-> a href="+code=c" class="sref">c /a>. a href="+code=auth_chunks" class="sref">auth_chunks /a>,i 237 /a>                                    ( a href="+code=sctp_hmac_algo_param_t" class="sref">sctp_hmac_algo_param_t /a>*) a href="+code=asoc" class="sref">asoc /a>-> a href="+code=c" class="sref">c /a>. a href="+code=auth_hmacs" class="sref">auth_hmacs /a>,i 238 /a>                                     a href="+code=gfp" class="sref">gfp /a>);i 239 /a>}i 240 /a>i 241 /a> spap class="comment">/* Make a key vector based op peer's paramnters */ /spapti 242 /a>static struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=sctp_auth_make_peer_vector" class="sref">sctp_auth_make_peer_vector /a>(i 243 /a>                                    const struct  a href="+code=sctp_assoc/at/op" class="sref">sctp_assoc/at/op /a> * a href="+code=asoc" class="sref">asoc /a>,i 244 /a>                                     a href="+code=gfp_t" class="sref">gfp_t /a>  a href="+code=gfp" class="sref">gfp /a>)i 245 /a>{i 246 /a>        return  a href="+code=sctp_auth_make_key_vector" class="sref">sctp_auth_make_key_vector /a>( a href="+code=asoc" class="sref">asoc /a>-> a href="+code=peer" class="sref">peer /a>. a href="+code=peer_random" class="sref">peer_random /a>,i 247 /a>                                          a href="+code=asoc" class="sref">asoc /a>-> a href="+code=peer" class="sref">peer /a>. a href="+code=peer_chunks" class="sref">peer_chunks /a>,i 248 /a>                                          a href="+code=asoc" class="sref">asoc /a>-> a href="+code=peer" class="sref">peer /a>. a href="+code=peer_hmacs" class="sref">peer_hmacs /a>,i 249 /a>                                          a href="+code=gfp" class="sref">gfp /a>);i 250 /a>}i 251 /a>i 252 /a>i 253 /a> spap class="comment">/* Set the ption of the assoc/at/op shared key base op the paramnters /spapti 254 /a> spap class="comment"> * given.  The algorithm is: /spapti 255 /a> spap class="comment"> *    From the endpoint pair shared keys and the key vectors the /spapti 256 /a> spap class="comment"> *    assoc/at/op shared keys are computed.  This is performed by selecting /spapti 257 /a> spap class="comment"> *    the numerically smaller key vector and concatenat/ng it to the /spapti 258 /a> spap class="comment"> * 
  endpoint pair shared key, and then concatenat/ng the numerically /spapti 259 /a> spap class="comment"> *    larger key vector to that.  The result of the concatenat/op is the /spapti 2618.a> spap class="comment"> *    assoc/at/op shared key. /spapti 261 /a> spap class="comment"> */ /spapti 262 /a>static struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=sctp_auth_asoc_set_secret" class="sref">sctp_auth_asoc_set_secret /a>(i 263 /a>                        struct  a href="+code=sctp_shared_key" class="sref">sctp_shared_key /a> * a href="+code=ep_key" class="sref">ep_key /a>,i 264 /a>                        struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=first_vector" class="sref">first_vector /a>,i 265 /a>                        struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=last_vector" class="sref">last_vector /a>,i 266 /a>                         a href="+code=gfp_t" class="sref">gfp_t /a>  a href="+code=gfp" class="sref">gfp /a>)i 267 /a>{i 268 /a>        struct  a href="+code=sctp_auth_bytes" class="sref">sctp_auth_bytes /a> * a href="+code=secret" class="sref">secret /a>;i 269 /a>         a href="+code=__u32" class="sref">__u32 /a>  a href="+code=offset" class="sref">offset /a> = 0;i 270 /a>         a href="+code=__u32" class="sref">__u32 /a>  a href="+code=auth_len" class="sref">auth_len /a>;i 271 /a>i 272 /a>         a href="+code=auth_len" class="sref">auth_len /a> =  a href="+code=first_vector" class="sref">first_vector /a>-> a href="+code=len" class="sref">len /a> +  a href="+code=last_vector" class="sref">last_vector /a>-> a href="+code=len" class="sref">len /a>;i 273 /a>        if ( a href="+code=ep_key" class="sref">ep_key /a>-> a href="+code=key" class="sref">key /a>)i 274 /a>                 a href="+code=auth_len" class="sref">auth_len /a> +=  a href="+code=ep_key" class="sref">ep_key /a>-> a href="+code=key" class="sref">key /a>-> a href="+code=len" class="sref">len /a>;i 275 /a>i 276 /a>         a href="+code=secret" class="sref">secret /a> =  a href="+code=sctp_auth_create_key" class="sref">sctp_auth_create_key /a>( a href="+code=auth_len" class="sref">auth_len /a>,  a href="+code=gfp" class="sref">gfp /a>);i 277 /a>        if (! a href="+code=secret" class="sref">secret /a>)i 278 /a>                return  a href="+code=NULL" class="sref">NULL /a>;i 279 /a>i 280 /a>        if ( a href="+code=ep_key" class="sref">ep_key /a>-> a href="+code=key" class="sref">key /a>) {i 281 /a>                 a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=secret" class="sref">secret /a>-> a href="+code=data" class="sref">data /a>,  a href="+code=ep_key" class="sref">ep_key /a>-> a href="+code=key" class="sref">key /a>-> a href="+code=data" class="sref">data /a>,  a href="+code=ep_key" class="sref">ep_key /a>-> a href="+code=key" class="sref">key /a>-> a href="+code=ctp_auth_bytes /a> * a href="+code=sctp_auth_make_key_282" id vL2a href="net/sctp/auth.c#2ther /spasctp_auth_create_key /a>( a href=1comsspa0UTH, Secdata /a>/a> * a href="+code=las=randvL277" class="line" namn vL277"> 852.c#2ther /spasctp_auth_create_key /#L183" id2vL183" class="line" namn2vL18328code=length" class="sref">length ss="comme2t"> * Create a key vecto2 as d28code=length" class="sref">le) {i 281 /a>                 a href="+code=memcpy" class="sass="sref">memcpy /a>( a href="+code=new" class="sref">new /a>->class="line" namn vL272"> 272 /a>         a href="+code=auth_le href="+code=ep_key" class="sref">ep_key /a>class="line" namn vL272"> 272 /a>         a href="+code=auth_len" class="sref">auth_len s="sref">ep_key /a>-> a href /a>;i 272 /a>         a href="+code=auth_len" class="sref">auth_len ="sref">ep_key /a>-> a href=auth_lenaramnter sent by each en2point28226" class="line" namn vL226"> 22"> *    T2ese paramnters include t2e par28L207" class="line" namn vL20) {i 281 /a>                 a href="+code=memcpy" class="sass="sref">memcpy /a>( a href="+code=new" class="sref">new /a>->de=first_vector" class="sref">first_vector /a>-> a href="+ href="+code=ep_key" class="sref">ep_key /a>de=first_vector" class="sref">first_vector /a>-> a href="+code=len" class="sref">les="sref">ep_key /a>-> a hrefL278"> 27the paramnter ption, but2paddi28ref="+code=NULL" class="sref">NULment"> * 2  removed from this conc2tenat29are the samn, compare numbers */ /s268"> 268 /a>        struct  a href="+code=sctp_auth_bytes" ent"> *  2 computalen2"> *    o2itted from the concatena2/op p29L251" class="line" namn vL251"> 2vL192"> 122 /a> spap class="commen2"> * 2  are called the two key vec/">/* /spapn /spapti 184 /a> spap cl2ref="+cod2=sctp_auth_make_key_vect2r" cl29nt"> * given.  The algorithm ey. /spapti2ctp_random_param_t /a> *2a hre2="+coda> spap class="comment"> */ /spapti 262 /a>s a hrefc struct  a href="+code=sctp_auth_by a hrefc stru="sref">sctp_auth_bytes /a> * a hs="sref">2ctp_chunks_param_t /a> *2a hre2="+code=chunks" class="sref">cccccccccca href="net/sctp/auth.c#L243" id vL243" class="line" namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef="+code=hmacs" class="sref">>>>>>>>>>ecret /a>(i 263 /a>                        struct  a href="+code=sctp_shared_key" ef="+code2gfp_t" class="sref">gfp_2 /a> 29eer_hmacs" class="sref">peer_hmacs /a>ector /a>,i 266 /a>                         a h3 /a>)ivector3ytes" cla3s="sref">sctp_auth_bytes3/a> *3a href="+code=ector /a>,i 265 /a>    " claet/sctp/auth.c#L246" id v " claet/sctp/au  a href="+code=sctp_auth_bytes"3="+code=_3u32" class="sref">__u32 3a>   3a href="+code=ector /a>,i 265 /a>   classet/sctp/auth.c#L246" id vclasset/sctp/au  a href="+code=sctp_auth_bytes"3=3+code=_3u /a> spap class="commen3ef="+303href="+code=ector /a>,i 264 /a>                        struct  a href="+code=sctp_auth_bytes" class="sref3> = 0;iasoc /a265"> 265 /a>                        struct  a href="+codhref="+code=sctp_auth_bytes"3=5= 0;i,i 264 /a>   5"> 275 /a>i 205 /a>        if (3a hre3="+code=chunkstiector /a>,iparam_hdr /a>. 3 href3"+code=length" class="sref">lengt3 /a>);i 3href="+co3e=len" class="sref">len 3a>,  3 href="+code=gcalled the two key vec/">Nowfwe nea hro buil id vL255" class=y. /spapti 209 /a>       3if (!31k to see if the longer number is /sp*L184" id v L184" class="line" namn vL184"> 184 /a> spap cl3vL210"> 230 /a>                ret3rn  a31d-zero padded.  If it is not, it /sp 63. 2spapti 185 /a> spap class="3L /a>;i 186 /a> spap class="comme3href="+co3e=len" class="sref">len 3a> = 31 are called the two key vect, it /sp 63. 2spapti 187 /a> spap class="commen3n /a>;i 188 /a> spap class="comm3hdr" clas3="sref">param_hdr /a>. a3href=31nt"> * given.  The algorithm, it /sp 63. /spapti 189 /a> spap class="co3_hdr" cla3s="sref">param_hdr /a>. 3 href31red keys and the key vectors, it /sp 63. /spapti 1918.a> spap class="com3 /a>);i 191 /a> spap class="commen3namn vL213"> 217 /a>        if ( a3href=31ctor and concatenat/ng it to, it /sp 63. /spaptioffset /a>, 3a hre31en concatenat/ng the numeric, it /sp ey. /spaptiparam_hdr /a>. a3href=32239" class="line" namn vL239"> 23_hdr" cla3s="sref">param_hdr /a>. 3 href32 href="+code=new" class="sre " claet/sctp/auth.c#L246" id v " claet/sctp/au  a uth.c#L276" id vL276" class= /a>static struct  a href="+code=sctp_auth_bytes" class="sref">s                            const struct  atp_auth_create_key" class="sref">sctp_auth_create_key /a>( a href="+co3 href="ne3/sctp/auth.c#L221" id vL321" c32L271" class="line" namn vL27classet/sctp/auth.c#L246" id vclasset/sctp/au  a uth.c#L276" id vL276" class= /a>static struct  a href="+code=sctp_auth_bytes" class="sref"                            const struct  atp_auth_create_key" class="sref">sctp_auth_create_key /a>( a href="+co3 ref="+co3href="net/sctp/auth.c#L232" id32 href="+code=len" class="sref">l3hdr" clas3="sref">param_hdr /a>. a3href=32ref="+code=asfp" class="sref">gfpclasset/sctp/auth.c#L246" id vclasset/sctp/au  a u|| class="sref">gfp " claet/sctp/auth.c#L246" id v " claet/sctp/au  a                          a h3/a>));imemcpy /ua href="+code=newut  a href="+code=sctp_auth_bytes"3ine" namn3vL225"> 225 /a>        r3turn 32+code=length" class="sref">lengt3 /a>;iFiguspawuthref=ordass="l190" id vL255line" nalas" camn vL188"> 188 /a> spap class="comm36 /a>}i/* Make a key3vecto33k to see if the longer number is /sp*L id vL256" class="line" namn vL2 /spaptisctp_assoc/at/op /3> * a33utomatically larger numerically. /spALGOctp/auth.c#L258" id vL258" class="line" nam /spaptigfp_3 /a> 33 are called the two key vect, it /sp 63.ref="net/sctp/autIfid vL255" class="/spaequalclas9" id vtp/auth.c#L254" id vL254" class="l3sdr" clas3ref="net/sctp/auth.c#L233" id 33hared key base op the paramn, it /sp 63.ctp/5" cass="lline" nac#L25f="net/sctp/auth.cordass=namn vL259"> 259 /a> spap class="commen3ref="+cod3=sctp_auth_make_key_vect3r" cl33nt"> * given.  The algorithm, it /sp 63.p/auth.c#ef="net/sc, follow"line"et/schortpti 259 /a> spap class="commen3rne" namn3="sref">c /a>. a href="+3ode=a33red keys and the key vectors, it /sp 63.follow"line"et/s169" id 259 /a> spap class="commen3r/a>;ic /a>. a href="+3ode=a33  This is performed by selec, it /sp 63. class="/spaid see" n/auth.maycam6" id vL186" cine" namn vL257"> 257 /a> spap class="co3ode=c" cl3ss="sref">c /a>. a href=3+code33ctor and concatenat/ng it to, it /sp 63./spapti);ioffstisctp_auth_make_local_vector /a>(i<" class="sref">offsclasset/sctp/auth.c#L246" id vclasset/sctp/au  a h_create_key /a>( a href="+co3pap class3"comment">/* Make a key 3ector342ef="+code=asfp" ass="sref">offstisctp_auth_mak64"> 264 /a>                        struct  a href="+code= vL212"> 212 /a>   " claet/sctp/auth.c#L246" id v " claet/sctp/au  a href="+code=sctp_auth_bytes"3p" class=3sref">sctp_assoc/at/op /3> * a3href="+code=asoc" clas65"> 265 /a>                        struct  a href="+cod vL212"> 212 /a>  classet/sctp/auth.c#L246" id vclasset/sctp/au  a href="+code=sctp_auth_bytes"3ef="+code3gfp_t" class="sref">gfp_3 /a> 34_vector" clas} else0 /a>        if ( a href="+co3fne" namn3ref="net/sctp/auth.c#L243" id 34"+code=chunks" class="sref">chunks /                     struct  a href="+code= vL212"> 212 /a>  classet/sctp/auth.c#L246" id vclasset/sctp/au  a href="+code=sctp_auth_bytes"3e/a>;ipeer /a>. a href="+3ode=p3er_random" class="sref65"> 265 /a>                        struct  a href="+cod vL212"> 212 /a>   " claet/sctp/auth.c#L246" id v " claet/sctp/au  a href="+code=sctp_auth_bytes"3pde=c" cl3ref">peer /a>. a href="+3ode=p3er_chunks" cla"+code=len" class="sref">len3er" class3"sref">peer /a>. a href=3+code34ref="+code=NULL" class="sref">NU3         3                        3     35de=offset" class="sref">offs5"> 275 /a>istatic struct  a href="+code=sctp_auth_bytes" class="sre63"> 263 /a>                        struct  a h="sref">chunks /                     struct  a href="+code="sref">ep_key /a>de=first_vector" class="sref">first_vectosctp_auth_bytes" class="sref3/a>);isctp_auth_make_local_vector /a>(i<" cl" class="sref">offsey" class="sref">sctp_auth_create_key /a>( a href="+co30 /a>}imemcpy /ua href="+code=newut  a :create_key /a>( a href="+co30="+code=3href="net/sctp/auth.c#L232" id35L222" class="line" namn vL22kfree href="+code=nekfreesref"                " claet/sctp/auth.c#L246" id v " claet/sctp/au  a h_create_key /a>( a href="+co30" class=3t the ption of the assoc3at/op35L213" class="line" namn vL21kfree href="+code=nekfreesref"               classet/sctp/auth.c#L246" id vclasset/sctp/au  a h_create_key /a>( a href="+co3ne" namn 3L254"> 254 /a> spap clas3="com35 href="+code=len" class="sref">l3"comment"3 *    From the endpoint 3air s35245" class="line" namn vL245"> 245 /68"> 268 /a>        struct  a href="+code=sctp_auth_bytes"3*    asso3/at/op shared keys are c3mpute3.  Thi"+code=len" class="sref">len3ment"> * 3  the numerically smalle3 key 35L227" class="line" namn vL227"> 3nt"> * 
 3endpoint pair shared key3 and 3hen concatenat/ng the numeri82"> 182 /a>i *    l3rger key vector to that.3 The 3esult of the concatenat/op is tPopul/spa="net/sctp/auth.overlayclistlass="et/s1ist"> 182 /a>i);i 2618.a> spap class3"comm3nt"> *    assoc/at/op shared k 262 /a>s opy_ a href=3+code34ref="+ vL262"> th_by a hrefc stru="sref">sctp_auan href="+code=sctp_auth_                                  ( a hre261" id sref">sctp_auan href261" id uct  a href="+code=sctp                 f="net/sctp/auth.c#L253" id 35"srode=ep_ke3" class="sref">ep_key /a3,i 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef=3ctor" cla3s="sref">first_vector /a3,i( a hre" namn vL266"> 266 /a>                         a h3 /a>)ilast_vector /a3,igfp /a3)i 263 /a>                        struct  a href="+code=scsh263 /a>             h struct  shared keys are c3mpute3.  T" class="3ine" namn vL267"> 267 /a3{i 263 /a>                        struct  a href="+code=sc class="line" namn vL225"> 225 /a>        return  a h3ode=secre3" class="sref">secret /a3;ioffset /a> = 3;i            aa 3_empt      &ref">ep_key /a>- 248 /a>                                       261" id         str"sref">sctp_auan261" id         str"f="ne> 254 /a> spap clas3="com35 hrauth_len"3class="sref">auth_len /a3;i 271 /3>i             h struct , &ref">ep_key /a>-tp                 f="n                    261" id         str"sref">sctp_auan261" id         str"f="nenet/sctp/auth.c#L243" id 34"+cef="+code3len" class="sref">len /a3;i 208 /a>   href="+coth_   hs="srsref">sctp_auan href="+coth_   hs="sr id vclasset/sctp/aush263 /a>             h struct /op 63. 2spapti( a href="+co3 ref="+co3href="net/sctp/auth.c#L232" id32 href="+code3key" class="sref">key /a3)i 209 /a>        if (! a h3ef="+code3len" class="sref">len /a3;i 225 /a>        return  a h35" class=3line" namn vL275"> 275 /3>igfp /a>3;imemcpy href="+code=data" class=" vL208"> 208 /a>   h263 /a>             h struct /op 63. 2spaptisecret /a3)i 208 /a>   href="+coL" nholdet/sctp/auth.c# href="+coL" nhold id vclasset/sctp/au   a href="+code=memcpy" class="sref">memcpy href="+code=data" class=""net/sctp/auth.c#L232" id32 hrede=secre3LL" class="sref">NULL /a3;i,iep_key /a>-   a href="+code=memcpy" class="sref">memcpy hre_aa 3et/sctp/auth.c#L" nep_key /a>- 248 /a>                                       261" id         str"sref">sctp_auan261" id         str"f="nenet/sctp/auth.c#L232" id32 hr9" class=3line" namn vL279"> 279 /3>ikey /a>)3{i__u32 /a>  a href="+code3 852.c#2t3er /spasctp_auth_create_3ey /#38sref">param_hdr /a>. a3href=32refe=length"3class="sref">length ss="3omme23"> * C"+code=sctp_autnomeref="+code=peer"nomer225"net/sctp/auth.c#L232" id35L22e=length"3class="sref">le) {isctp_auan href="+codeautoy str"     &ref">ep_key /a>- 248 /a>                                       261" id         str"sref">sctp_auan261" id         str"f="neef">__u32 /a>  a href="+code3 " class=3line" namn vL27ref="+cod3=sctp38/a>        struct  a-               ENOMEMsref">sctp_auanENOMEMss="> 225 /a>        return  a h3" class="3ine" namn vL226"> 22"> *3   T238 the numerically smalle3 key 35L227" class=3line" namn vL20) {iNULment3> * 23 removed from this conc2tenat29ar3 the samn3 compare numbers */ /s263"> 2639sctp/auth.overlayclistlass=/* Publicstruerface=c" hs="se" namn vL253"> 253 /a> spa3L261" class="line" namn 3L261"36cesf="+code=3en" class="sref">len2"> 3    o39i 2vL193"> 1239ef="net/sctp/auth.c3ref="+cod3=sctp_auth_asoc_set_secr3t" cl3ss="e called 3he two key vec/">/* /spa3n /sp39a href=3+code34ref="+ vL262"> th_by a hini3_activsecret" class="sref">secret /ay a hini3_activsecre     " namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmaceate_key /a>( a hre" namn vL266"> 266 /a>                         a h3 /a>)i * given3  The algorithm ey. /spa3ti 264 /a>   5"> 275 /a>i 225 /a>        return  a h3oda> spap3class="comment"> */ /spa3ti 263 /a>                        struct  a href="+code=sctp_shared_key" ef="+code2gfp_t"> 225 /a>        return  a h3o class="3" class="sref">ccccccccc3a hre39ef="net/sctp/auth.c#L237" id30L22+code=hma3s" class="sref">>>>>>>>>3ecret3/a>(ic /a>. a href=3+code33cto_hmacs" c3ass="sref">peer_hmacs /a3ector39 vL184" class="ctp/auth.c#L254" id vL2hredon 241 t f="net/sdo3/a>thing3L261" class="line" namn 3L261"36ce4e=vector24 class="sref">vector3yte4" cla4056" class="line" namn vL2 /spapti,ii   5"> 275 /a>i                                          a href="+code=asoc" class="sref">asoc /aaet/scapabl3 /a>            et/scapabl3f="net/sctp/auth.c#L193" id 30co4ef="+code4ector /a>,i__u32 /a>  a href="+code4ef="+code4ector /a>,iparam_hdr /a>. a3href=32re4="+code=a4oc" class="sref">asoc /a465"> 465 /a>        auth.overlayclistlass=/* If  class="id="+casn-zero7 /a>w clauldn 241 t fi/a>an=sctp_auth_asoc_set_secr3t" cl3ss=4e5+code=a4o The algorithm ey. /spa4ctp/a40h.c#ef="net/sc, follow"line"et/schortp8" class="line" namn vL258w clan 241 t  256 /a cl3ss="sref">c /a>. a href=3+code33ct4ode=chunk4tiector /a>,iccccccccc4;i 3href4"+co340tipeer_hmacs /a4Nowfw4 nea hro buil ihref="+code=sctp_shared_key" ef="+code2gfp_t" vL208"> 208 /a>   href="+cog    hcret" class="sref">secret /ag    hcre id vclasset/sctp/au_assoc/at/o="sref">s2tp_hmaceate_key /a>( a  248 /a>                                       activsecre_idet/sctp/auth.c#activsecre_idf="neef">__u32 /a>  a href="+code4o see if 4he longer number is /sp*4184" 41ef="net/sctp/auth.c#L270" idBUG_ONass="line" namnBUG_ON      v " claet/sctp/tp_shared_key" ef="+code2gfp_t"eef">__u32 /a>  a href="+code4of="+code4.  If it is not, it /sp 43. 2s41ef="net/sctp/auth.c#L271" id vL24matically4larger numerically. /spA4GO 2s41ef="net/sctp/auth.c#L272" id vL276" class= /a>static struct  a href="+code=sctp_auth_bytes" chrefc stru="sref">sctp_auth_bytes /a> * a hs="sref">2ctp_chuclasset/sctp/au_assoc/at/o="sref">s2tp_hmaceate_key /a>( a s /                     struct  a href="+code="shref="+co3 ref="+co3href="net/sctp/auth.c#L232" id32 h4e called 4he two key vect, it /sp 43. 2s41ef="net/sctp/auth.c#L277" id vL277" class="line" namn vL277"> 277 /a>        if (! a href="+4ed key ba4e op the paramn, it /sp 43. /s41ef="net/sctp/auth.c#Lruct  a-               ENOMEMsref">sctp_auanENOMEMss="> 225 /a>        return  a h4> * given4  The algorithm, it /sp 43. /s41    From the endpoint 3air s35244 keys and4the key vectors, it /sp 43. /s41ef="net/sctp/auth.c#L276" id href="+coL" npef="+co30="+code= href="+coL" npefp_chuclasset/sctp/au_assoc/at/o="sref">s2tp_hma                    a     63"> 263 /a>            a     63"> 263 ref="net/sctp/auth.c#L232" id32 h4e7e=chunk4formed by selec, it /sp 43. /s417f="net/sctp/auth.c#L276" id_assoc/at/o="sref">s2tp_hma                    a     63"> 263 /a>            a     63"> 263 ref=  a href="+code=sctvL2href="net/sctp/auth.c#L278"> 225 /a>        return  a h4r and con4atenat/ng it to, it /sp 43. /s41dpoint pair shared key3 and 3hen4concatena4/ng the numeric, it /sp 4y. /s41nea hro buil ruct  aref">__u32 /a>  a href="+code4" class="4ine" namn vL239"> 23_hdr4 cla342ef="net/sctp/auth.c#L250" id vL254ef="+code4new" class="sre " claet/4ctp/a42ef="net/sctp/auth.c#L271" id vL241" class=4line" namn vL27classet/s4tp/au42/a> spap class="commen2"> * 2  a4ef="+code4len" class="sref">l3hdr"4clas342tigfpclas4et/sc4p/authvL263" class="line" namn vL263"> 263 /a>                        struct  a href="+code=scshref="+cog    hcret" class="sref">secret /ag    hcre id vuth_asoc_set_secr3t" cl3ss=4= * given4s="sref"goro ="sref">mem4py /u4 href="+code=newut  a                 ="line" namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef=4de=length4 class="sref">lengt3 /a>4i__uth                    hre_idet/sctp/auth.c#L" nidth_c7 /a>        if (! a href="+4f="+code=4called the two key vec/"4Figus42ef="net/sctp/auth.c#L267" id vL264r and con4atenat/ng it to, it /sp 4/auth42ef="net/sctp/auth.c#L268" id vL268" clas263"> 263 /a>                        struct  a href="+code=schref="+code=data" class="> 225 /a>        return  a h48" class=4line" namn vL2o, it /sp 4184" 42removed from this conc2tenat29ar4o see if 4he longer number is /sp*4 id v43ef="net/sctp/aref="net/sct  Followf="nFirine"earchamn vL253"> se"espap "line" namn vL255"> 255 /a23=sctp_auth_asoc_set_secr3t" cl3ss=4ero padde4.  If it is not, it /sp 43.h.c43h.c#L246" id v " claet/sctp/e" nfor_mn vet/sctp/auth.c#L" nfor_mn v id vclasset/sctp/auhref="+code=data" class=", &ref">ep_key /a>- 248 /a>                                       261" id         str"sref">sctp_auan261" id         str"f="nenet/sctp/auth.c#L243" id 34"+4matically4larger numerically. /spA4GOctp43h.c#L265" id p_auth_m> 173080 /a>       href="+code=data" class="/op 63. 2spapti        if (! a href="+4e called 4he two key vect, it /sp 43.ref43ef="net/sctp/auth.c#L263" id ruct  a href="+code=schref="+code=data" class="> 225 /a>        return  a h4ed key ba4e op the paramn, it /sp 43.ctp43ef="net/sctp/et/sctp/auth.c#L250" id vL254> * given4  The algorithm, it /sp 43.p/a43    From the endpoint 3air s35244 keys and4the key vectors, it /sp 43.fol43/a>        struct  a href="+code=scline" namn3" namn vL305"> 205 /a>        if (3a hre3="+4his is pe4formed by selec, it /sp 43. cl43 the numerically smalle3 key 35L24r and con4atenat/ng it to, it /sp 43./sp43dpoint pair shared key3 and 3hen4concatena4/ng the numeric, it /sp 4y. /s4aptioffsti;i 2digein namn SHA17 /a>SHA256.  Wredone" nahp clonc3ss="sref">c /a>. a href=3+code33ct4="+code=a4fp" ass="sref">offstisctp4auth_mak64"> 264 /a>    4     44net/sctp/autIfid vL255" clas* user ="ltex59"> 2 naautces uset/spre-ss=oc3ode=ss="cossible transautps=sctp_auth_asoc_set_secr3t" cl3ss=4rd key ba4oc" clas65"> 265 /a>    4     444" id vL184" class="line" namn"se" na"line" naini3 time3L261" class="line" namn 3L261"36ce4ctor" cla4} else0 /a>        if ( 4 href44ef="net/sctp/auth.c#s="sref">2ctp_random_param_t /a> *2a hre2="+4ode=chunk4" class="sref">chunks / 4     4      f=3+code34ref="+ vL262"> th_bini3_hmac4 /a>   5"> 275 /a>i 243 /a>     261" id sref">sctp_auan href261" id uct  a href="+code=sctp                 f="neeate_key /a>( a hre" namn vL266"> 266 /a>                         a h3 /a>)i 265 /a>    4     44ef="net/sctp/auth.c#L267" id vL264hunks" cl4"+code=len" class="sref"4len3e44ef="net/sctp/auth.c#L268" id vL268"crypto_hasvet/sctp/auth.c#crypto_hasvuct  a href="+code=sctfref="+code=peer"tfrref=  a href="+code=scline" namn3" namn vL305"> 205 /a>        if (3a hre3="+4="+code=N4LL" class="sref">NU3    4    344ef="net/sctp/auth.c#L269" id vLthe key vecsref">__uth     p/auth.c#L269" ididet/sctp/auth.c#idth_c05 /a>        if (3a hre3="+4offset" c4ass="sref">offs5"> 275 /4>iparam_hdr /a>. 3 href32 h4ef">sctp_4uth_make_local_vector /a4(i<" 4l" class="srefaref="net/sct  Followf="nine" natransautps amn alreadycss=ocode58w camn done">2ctp_random_param_t /a> *2a hre2="+41"="sref"4memcpy /ua href="+code=n4wut  45t/sctc  struu> 17.c#L277" id vL277a>i   5"> 275 /a>i 275 a hrehmac4ref=  a href="+code=scline" namn3" namn vL305"> 205 /a>        if (3a hre3="+43" class=4line" namn vL21kfree hre4="+co45ef="net/sctp/auth.c#Lruct  aref">__u32 /a>  a href="+code4ef="+code4len" class="sref">l3"com4ent"345+co3fne" namn3f">__u32 /a>  a href="+code4ede=chunk4ine" namn vL245"> 245 /64"> 2645f="net/sctp/auth.c#L223" id 327r4hi"+code=4en" class="sref">len3men4"> * 45ef="net/sctp/auth href="+code= vtp                 f="n                    a hrehmac4 /a>   5"> 275 a hrehmac4ref=et/sctp/auth.c#L193" id 30co47" class=4line" namn vL227"> 3nt">4* 
 345ef="net/sctp/auth.c#L278" idref">__u32 /a>  a href="+code4e"+code=N4/ng the numeri82"> 182 /4>i2ctp_random_param_t /a> *2a hre2="+4 *    ass4c/at/op shared k 275 a hrehmac4ref=  a href="+code=sckzss=ocf="+code=data" czss=oc id vuth_asoc_set_secr3t" cl3ss=4s.  The r4sulting two vectey. /spa4ti 243 /a>crypto_hasvet/sctp/auth.c#crypto_hasvuct  a)amnvL243"> 243 /a>54" _lass_NUM_ /a>Set/sctp/auth.c#54" _lass_NUM_ /a>S_hmac_algo_param_t /a>2* a h2ef=4srti 262 /a4s opy46ef="net/sctp/auth.c#L263" id  id v " claet/sctp/href="+co3 ref="+co3href="net/sctp/auth.c#L232" id32 h4ode=ep_ke4" class="sref">ep_key /a4,i 275 a hrehmac4ref=et/sctp/auth.c#L193" id 30co4ctor" cla4s="sref">first_vector /a4,isctp_auanENOMEMss="> 225 /a>        return  a h4ector" cl4ss="sref">last_vector /a4,igfp /a4)i 243 /a>54" _lass_NUM_ /a>Set/sctp/auth.c#54" _lass_NUM_ /a>S_hma;/auth.c#L269" ididet/sctp/auth.c#idth_c++enet/sctp/auth.c#L243" id 34"+4" class="4ine" namn vL267"> 267 /a4{isecret /a4;i,iSupport> 2IDs haveecretioffset /a> = 4;i  fieldse"es, so vtp/8w clan ss=oc3ode=snd usehref="net/sctp/auth.c#L233" id31ha4o*    ass4class="sref">auth_len /a4;i 271 /4>ilen /a4;ikey /a4)iiiasoc /ahmac_>keyet/sctp/auth.c#hmac_>keyref=et/sctp/auth.c#L193" id 30co4ef="+code4len" class="sref">len /a4;i 275 /4>igfp /a>4;i *2a hre2="+4e class="4" class="sref">secret /a4)i 275 a hrehmac4ref=[auth.c#L269" ididet/sctp/auth.c#idth_c]et/sctp/auth.c#L193" id 30co4ede=secre4LL" class="sref">NULL /a4;i,i 279 /4>iparam_hdr /a>. 3 href32 h4="+code=k4y" class="sref">key /a>)4{ioffseyaref="net/sct  Followf="nAs=oc3od=ic#LIDp*2ctp_random_param_t /a> *2a hre2="+4f="+code=4tp_auth_bytes /a> * a hr4f="+c48h.c#L265" id p_auth_m href="+code=sctfref="+code=peer"tfrref=  a href="+code=sccrypto_ss=oc_hasvet/sctp/auth.c#crypto_ss=oc_hasv id vclasset/sctp/au/a>iiasoc /ahmac_>keyet/sctp/auth.c#hmac_>keyref=, 0c_algo_param_t /a>2* a h2ef=4 852.c#2t4er /spasctp_auth_create_4ey /#48ef="net/sctp/auth.c#L263" id  id  id p_auth_m href="+code=scCRYPTO_ALG_ASYNCet/sctp/auth.c#CRYPTO_ALG_ASYNCref="net/sctp/auth.c#L232" id32 h4e=length"4class="sref">length ss="4omme248ef="net/sctp/auth.c#Lauth href="+code=scIS_ERRet/sctp/auth.c#IS_ERR id vclasset/sctp/autfref="+code=peer"tfrref=)et/sctp/auth.c#L193" id 30co4e=length"4class="sref">le) {i 22"> *4   T248            struct  a href="+cod vL2tp                 f="n                    a hrehmac4 /a>   5"> 275 a hrehmac4ref=[auth.c#L269" ididet/sctp/auth.c#idth_c]  a href="+code=sctfref="+code=peer"tfrref=> 225 /a>        return  a h4  class="4line" namn vL20) {ipeer /a>. a href=3+code34re4="+code=N4LL" class="sref">NULment4> * 24 removed from this conc2tenat29ar4 the samn4 compare numbers */ /s264"> 264 /a>        struct  aref">__u32 /a>  a href="+code4f="+code=4en" class="sref">len2"> 4    o49ef="net/sctp/auth.c#L271" id vL24f="+code=4line" namn vL251"> 2vL194"> 1249:create_key /a>( a href_era href="+code=asmn _erass="net/sctp/auth.c#L232" id35L24e called 4he two key vec/">/* /spa4n /sp49=nekfreesref" ref="net/sct  Followf="nelean up3/a> suca> sful ss=oc3o"> se*2ctp_random_param_t /a> *2a hre2="+4ed key ba4e op the paramntesctp/au4h.c#L49=nekfreesref"               /a>i   5"> 275 /a>i 275 a hrehmac4ref=eef">__u32 /a>  a href="+code4f=length"4  The algorithm ey. /spa4tisctp_auanENOMEMss="> 225 /a>        return  a h4oda> spap4class="comment"> */ /spa4tipeer /a>. a href=3+code34re4o class="4" class="sref">ccccccccc4a hre49ef="net/sctp/auth.c#L237" id30L24+code=hma4s" class="sref">>>>>>>>>4ecret49ti *2a hre2="+4e"+code=N4ass="sref">peer_hmacs /a4ector49 vL18void"               /a>i   5"> 275 /a>i 275 a hrehmac4ref=[]et/sctp/auth.c#L193" id 30co5e=vector25 class="sref">vector3yte5" cla5s="sref">sctp_auth_bytes3/a> *3a h5ef="+code5ector /a>,i,i * 2  a5ef="+code5ector /a>,i   5"> 275 a hrehmac4ref=et/sctp/auth.c#L193" id 30co5="+code=a5oc" class="sref">asoc /a565"> 565 /a>                ruct  > 225 /a>        return  a h5e5+code=a5o The algorithm ey. /spa5ctp/a50    From the endpoint 3air s35245ode=chunk5tiector /a>,i 243 /a>54" _lass_NUM_ /a>Set/sctp/auth.c#54" _lass_NUM_ /a>S_hma;/auth.c#L269" idiet/sctp/auth.c#iss="++et/sctp/auth.c#L193" id 30co5=7e=chunk5t class="sref">ccccccccc5;isctp_auth_bytes3/a> *3a h5e8e=chunk5t" class="sref">>>>>>>>>5"+co350ef="net/sctp/auth.c#Lauth href="+code= va hrehmac4 /a>   5"> 275 a hrehmac4ref=[auth.c#L269" idiet/sctp/auth.c#iss="]et/sctp/auth.c#L193" id 30co5e9e=chunk5tss="sref">peer_hmacs /a5Nowfw50a>,i   5"> 275 a hrehmac4ref=[auth.c#L269" idiet/sctp/auth.c#iss="]e> 225 /a>        return  a h5o see if 5he longer number is /sp*5184" 51ef="net/sctp/numerically smalle3 key 35L25of="+code5.  If it is not, it /sp 53. 2s51h.c#L246" id v " claet/sctp/elasset/sctp/auth.c#L246" id vclasset/sctp/aua hrehmac4 /a>   5"> 275 a hrehmac4ref=eef">__u32 /a>  a href="+code5matically5larger numerically. /spA5GO 2s51ef="nnumerically smalle3 key 35L25of="+code5he two key vect, it /sp 53. 2s51sref">param_hdr /a>. a3href=32re5ed key ba5e op the paramn, it /sp 53. /s51ef="n>param_hdr /a>. a3href=32re5e5+code=a5  The algorithm, it /sp 53. /s51    F" namn vL243"> 243 /a>     hmacet/sctp/auth.c#/a>i__uth                    hmac_idet/sctp/auth.c#hmac_idref=et/sctp/auth.c#L193" id 30co5 keys and5the key vectors, it /sp 53. /s51ef="net/sctp/auth.c#L243" id 34"+5e7e=chunk5formed by selec, it /sp 53. /s517f="net/sctp/ruct  a&ref">ep_key /a>-/a>ii__u32 /a>  a href="+code5m8e=chunk5atenat/ng it to, it /sp 53. /s51dpoinnumerically smalle3 key 35L25o9e=chunk5/ng the numeric, it /sp 5y. /s51removed from this conc2tenat29ar5" class="5ine" namn vL239"> 23_hdr5 cla352sctp/auth.overlayclistlass=/* Get3/aLhmac deacrip3"> 2inautp53"> 2vtp/8w clan use8c" buil3href="net/sctp/auth.c#L233" id31ha5ef="+code5new" class="sre " claet/5ctp/a52il3hdr"5clas352ti 243 /a>     hmacet/sctp/auth.c#/a>i 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmaet/sctp/auth.c#L193" id 30co5="+code=a5fp" class="sref">gfpclas5et/sc524" idet/sctp/auth.c#L243" id 34"+5= * given5s="sref"goro ="sref">mem5py /u52h.c#L265" id vL265" class="line" namn vLhmac_193"_pararef="+code=peer"mn vLhmac_193"_parart  a href="+code=sctphmac4 /a>   5"> 275 hmac4ref=ef">__u32 /a>  a href="+code5de=length5 class="sref">lengt3 /a>5i__uth                    n_el3et/sctp/auth.c#n_el3ref=ef">__u32 /a>  a href="+code5d7e=chunk5called the two key vec/"5Figus527f="net/sctp/auth.c#L276" id__uthe key vecsref">__uth                    idet/sctp/auth.c#idth_c  a0;f">__u32 /a>  a href="+code5d8e=chunk5atenat/ng it to, it /sp 5/auth52ef="net/sctp/a=3+code34ref="+ vLiet/sctp/auth.c#iss="> 225 /a>        return  a h58" class=5line" namn vL2o, it /sp 5184" 52removed from this conc2tenat29ar5o see if 5he longer number is /sp*5 id v53ef="net/sctp/aref="net/sct  Followf="nIf hrehaveea default llory, use8isp*2ctp_random_param_t /a> *2a hre2="+5ero padde5.  If it is not, it /sp 53.h.c53h.c#L265" id authref="+code=sctp_assoc/at/o="sref">s2tp_hma                    default_hmac_idet/sctp/auth.c#default_hmac_id_hmaet/sctp/auth.c#L193" id 30co5matically5larger numerically. /spA5GOctp53h.c#L265" id p_auth_mruct  a&ref">ep_key /a>-/a>iis2tp_hma                    default_hmac_idet/sctp/auth.c#default_hmac_id_hma]ef">__u32 /a>  a href="+code5e called 5he two key vect, it /sp 53.ref53sref">param_hdr /a>. a3href=32re5ed key ba5e op the paramn, it /sp 53.ctp53ef="net/sctp/vref="net/sct  Followf="nSince2hredocass=haveea default llory, fiass="3Ltor"  lloryctp_random_param_t /a> *2a hre2="+5e * given5  The algorithm, it /sp 53.p/a5th.c#ef="net/sc, follow"line"et/schortpwi *2a hre2="+5e7e=chunk5formed by selec, it /sp 53. cl537f="net/sctp/auth.c#L276" idhmac4 /a>   5"> 275 hmac4ref=  a href="+code=sc 248 /a>                                          a href="+code=asoc" class="sref">asoc /a+co3nhmac4 /a>   5"> 275 +co3nhmac4ss="> 225 /a>        return  a h5r and con5atenat/ng it to, it /sp 53./sp538.c#L265" id auth.c#L277" id vL27hmac4 /a>   5"> 275 hmac4ref=et/sctp/auth.c#L193" id 30co5m" class=5/ng the numeric, it /sp 5y. /s53a>,i 205 /a>        if (3a hre3="+5offset" c5ass="sref">offstiparam_hdr /a>. 3 href32 h5oro padde5uth_make_local_vector /a5(i<" 54h.c#L246" id v " claet/sctp/n_el3et/sctp/auth.c#n_el3ref=  avclasset/sctp/au toh4 /a>   5"> 275  toh4 id vclasset/sctp/auhmac4 /a>   5"> 275 hmac4ref=                     arar_hda href="+code=asoarar_hdaclass="sref">asoc /a259">  href="+code=as259"> ref=e -msizeof ef">ep_key /a>-/a>i 26/a>i        if (3a hre3="+5oatically5fp" ass="sref">offsti 243 /a>n_el3et/sctp/auth.c#n_el3ref=e/auth.c#L269" idiet/sctp/auth.c#iss="++esf">sctp_auth_bytes3/a> *3a h5ref">sctp5auth_mak64"> 264 /a>    5     5             struct  a href="+code= videt/sctp/auth.c#idth_c  aclasset/sctp/au toh4 /a>   5"> 275  toh4 id vclasset/sctp/auhmac4 /a>   5"> 275 hmac4ref=                    hmac_id4 /a>   5"> 275 hmac_id4ref=[auth.c#L269" idiet/sctp/auth.c#iss="]e> 225 /a>        return  a h5rd key ba5oc" clas65"> 265 /a>    5     54ef="n>param_hdr /a>. a3href=32re5ctor" cla5} else0 /a>        if ( 5 href54ef="net/sctp/auth.c#L ref="net/sct  Followf="nehecksic#Lidc naina>;i 2range">2ctp_random_param_t /a> *2a hre2="+5ode=chunk5" class="sref">chunks / 5     5             struct  aauthref="+code=sctpidet/sctp/auth.c#idth_ce=gctpvL243"> 243 /a>54" _lass_ /a>_ID_MAXet/sctp/auth.c#54" _lass_ /a>_ID_MAXref=e f">sctp_auth_bytes3/a> *3a h5r7e=chunk5ss="sref65"> 265 /a>    5     5             struct  atruct  a href="+code= videt/sctp/auth.c#idth_c  a0;f">__u32 /a>  a href="+code5hunks" cl5"+code=len" class="sref"5len3e54ef="net/sctp/auth.c#LLLLLLLLL="ltinue> 225 /a>        return  a h5="+code=N5LL" class="sref">NU3    5    354a>,ioffs5"> 275 /5>iparam_hdr /a>. 3 href32 h5ef">sctp_5uth_make_local_vector /a5(i<" 5l" class="sref">offseyvref="net/sct  Followf="nSe c nawiSupport> 2IDs haveecreti  fieldse"es, so vtp/8w clan ss=oc3ode=snd usehref="net/sctp/auth.c#L233" id31ha52" class=5line" namn vL22kfree hre5="+co55net/sctp/autIfid vL255" class="/spae        *Lic#m.  Wrelan safely just checksf9" _len,sf9" h.3"mn vL18href="net/sctp/auth.c#L233" id31ha53" class=5line" namn vL21kfree hre5="+co554" id vL184" class="line" nas="/spae        *L_len,sw clan 241 t ss=oc3od=ic#LTFM3L261" class="line" namn 3L261"36ce5ef="+code5len" class="sref">l3"com5ent"355h.c#ef="net/sc, follow"line"et/schor        *2ctp_random_param_t /a> *2a hre2="+5ede=chunk5ine" namn vL245"> 245 /65"> 2655            struct  aauth.c#L209" id vL20/a>iiasoc /ahmac_>keyet/sctp/auth.c#hmac_>keyref=e f">sctp_auth_bytes3/a> *3a h5hi"+code=5en" class="sref">len3men5"> * 55            struct  atruct  a href="+code= videt/sctp/auth.c#idth_c  a0;f">__u32 /a>  a href="+code57" class=5line" namn vL227"> 3nt">5* 
 355ef="net/sctp/auth.c#LLLLLLLLL="ltinue> 225 /a>        return  a h5e"+code=N5/ng the numeri82"> 182 /5>i,iparam_hdr /a>. 3 href32 h5 *    ass5c/at/op shared koffseybreak> 225 /a>        return  a h5s.  The r5sulting two vectey. /spa5ti 262 /a5s opy56sref">param_hdr /a>. a3href=32re5ode=ep_ke5" class="sref">ep_key /a5,ifirst_vector /a5,i 205 /a>        if (3a hre3="+5ector" cl5ss="sref">last_vector /a5,igfp /a5)iep_key /a>-/a>ii        if (3a hre3="+5e" class=5ine" namn vL267"> 267 /a5{isecret /a5;ioffset /a> = 5;iii__betht  a href="+code=sctphmac4 /a>   5"> 275 hmac4ref=,stru/auth.c#L276" idn_el34 /a>   5"> 275  _el34ref=,sclasset/sctp/au__bethe key vecsref">__betht  a                hmac_idet/sctp/auth.c#hmac_idref=et/sctp/auth.c#L193" id 30co5o*    ass5class="sref">auth_len /a5;isctp_auth_bytes3/a> *3a h5o.  The r5line" namn vL271"> 271 /5>i__u32 /a>  a href="+code5ef="+code5len" class="sref">len /a5;ikey /a5)ilen /a5;i 243 /a>n_el34 /a>   5"> 275  _el34ref=e/auth.c#L269" idiet/sctp/auth.c#iss="++esf">sctp_auth_bytes3/a> *3a h55" class=5line" namn vL275"> 275 /5>i   5"> 275 hmac4ref=[auth.c#L269" idiet/sctp/auth.c#iss="]esf">sctp_auth_bytes3/a> *3a h55f="+code5fp" class="sref">gfp /a>5;i        if (3a hre3="+5e class="5" class="sref">secret /a5)ioffseybreak> 225 /a>        return  a h5ede=secre5LL" class="sref">NULL /a5;i,i 279 /5>ikey /a>)5{i 225 /a>        return  a h5 852.c#2t5er /spasctp_auth_create_5ey /#58ef="nnumerically smalle3 key 35L25=f="+code5class="sref">length ss="5omme258ef="n>param_hdr /a>. a3href=32re5e=length"5class="sref">le) {i_IDc naone"vtp/8w cllaim as 2*2ctp_random_param_t /a> *2a hre2="+5 " class=5line" namn vL27ref="+cod5=sctp58     f=3+code34ref="+ vL262"> th_ba    verify_hmac_idet/sctp/auth.c#262"> th_ba    verify_hmac_id id v="line" namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef=5" class="5ine" namn vL226"> 22"> *5   T258            struct  a   struct  aaaaaaaaa               __bethe key vecsref">__betht  a                hmac_idet/sctp/auth.c#hmac_idref=et/sctp/auth.c#L193" id 30co5  class="5line" namn vL20) {isctp_auth_bytes3/a> *3a h5="+code=N5LL" class="sref">NULment5> * 258a>,i 275 hmac4ref=ef">__u32 /a>  a href="+code5 the samn5 compare numbers */ /s265"> 2659ef="net/sctp/auth.c#L270" id__uthe key vecsref">__uth                    n_el3et/sctp/auth.c#n_el3ref=ef">__u32 /a>  a href="+code5f="+code=5en" class="sref">len2"> 5    o59ef="net/sctp/auth.c#L271" id vL25f="+code=5line" namn vL251"> 2vL195"> 1259t/sctc  struu> 17.c#L277" id vL27_assoc/at/o="sref">s2tp_hmaet/sctp/auth.c#L193" id 30co5e called 5he two key vec/">/* /spa5n /sp59            struct  aruct  aref">__u32 /a>  a href="+code5ed key ba5e op the paramntesctp/au5h.c#L59ef="n>param_hdr /a>. a3href=32re5f=length"5  The algorithm ey. /spa5ti   5"> 275 hmac4ref=  a " namn vL243"> 243 /a>     hmac_193"_pararef="+code=peer"mn vLhmac_193"_parart  a h) href="+code=sc 248 /a>                                       8 /a>           cclass="sref">asoc /aa hrehmac4 /a>   5"> 275 a hrehmac4ref=ef">__u32 /a>  a href="+code5e" class=5class="comment"> */ /spa5ti   5"> 275  toh4 id vclasset/sctp/auhmac4 /a>   5"> 275 hmac4ref=                     arar_hda href="+code=asoarar_hdaclass="sref">asoc /a259">  href="+code=as259"> ref=e -msizeof ef">ep_key /a>-/a>i 26/a>i        if (3a hre3="+5o class="5" class="sref">ccccccccc5a hre59ef="net/sctp/auth.c#L237" id30L25+code=hma5s" class="sref">>>>>>>>>5ecret5/a>(i 275 hmac4ref=                    hmac_id4 /a>   5"> 275 hmac_id4ref=,sclasset/sctp/aun_el3et/sctp/auth.c#n_el3ref=,sclasset/sctp/auhmac_idet/sctp/auth.c#hmac_idref=e05 /a>        if (3a hre3="+5o"+code=N5ass="sref">peer_hmacs /a5ector59 vL18numerically smalle3 key 35L26e=vector26 class="sref">vector3yte6" cla60"sref">param_hdr /a>. 3 href32 h6ef="+code6ector /a>,i 2 nato follow  c natex5 from 54" -lass:ctp_random_param_t /a> *2a hre2="+6ef="+code6ector /a>,i *2a hre2="+6e4="+code6e op the paramntesctp/au665"> 604" id vL184" class="line" namn"> 2nareceiveraof a  /a>-ALGO oarareteraSHOULD use8c"3Ltor"  aa 3e3href="net/sctp/auth.c#L233" id31ha6e5+code=a6o The algorithm ey. /spa6ctp/a60h.c#ef="net/sc, follow"line"mn">193"rithm8ispsupports3L261" class="line" namn 3L261"36ce6ode=chunk6tiector /a>,iccccccccc6;ii th_ba     et_default_hmac id v" namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef=6e8e=chunk6t" class="sref">>>>>>>>>6"+co360ef="net/sctp/auth.c#LLLLLLLLLLLLLLLLLLLLLLvL265" class="line" namn vLhmac_193"_pararef="+code=peer"mn vLhmac_193"_parart  a href="+code=sctphmac4 /a>   5"> 275 hmac4ref=et/sctp/auth.c#L193" id 30co6e9e=chunk6tss="sref">peer_hmacs /a6Nowfw60a>,isctp_auth_bytes3/a> *3a h6o see if 6he longer number is /sp*6184" 61ef="net/sctp/" namn vL243"> 243 /a>     261" id sref">sctp_auan href261" id uct  a href="+code=sctp                 f="n05 /a>        if (3a hre3="+6of="+code6.  If it is not, it /sp 63. 2s61h.c#L246" id v " claet/sctp/ vLthe key vecsref">__uth     p/auth.c#L269" ididet/sctp/auth.c#idth_c05 /a>        if (3a hre3="+6matically6larger numerically. /spA6GO 2s61ef="net/sctp/tru/  p/auth.c#L269" idiet/sctp/auth.c#iss="> 225 /a>        return  a h6of="+code6he two key vect, it /sp 63. 2s61            stru/ tp/auth.c#L276" idn_parar4 /a>   5"> 275  _parar4ss="> 225 /a>        return  a h6o4="+code6e op the paramn, it /sp 63. /s61ef="n>param_hdr /a>. a3href=32re6e5+code=a6  The algorithm, it /sp 63. /s61h.c#L265" id aref="net/sct  Followf="nine" nadefault idc naalreadyc"es, use8isp*2ctp_random_param_t /a> *2a hre2="+6 keys and6the key vectors, it /sp 63. /s61ef="net/sctp/authref="+code=sctp_assoc/at/o="sref">s2tp_hma                    default_hmac_idet/sctp/auth.c#default_hmac_id_hmaet/sctp/auth.c#L193" id 30co6e7e=chunk6formed by selec, it /sp 63. /s61            struct  aruct  > 225 /a>        return  a h6m8e=chunk6atenat/ng it to, it /sp 63. /s61dpoint pair shared key3 and 3hen6o9e=chunk6/ng the numeric, it /sp 6y. /s61nea hro buil auth.c#L276" idn_parar4 /a>   5"> 275  _parar4ss="  avclasset/sctp/au toh4 /a>   5"> 275  toh4 id vclasset/sctp/auhmac4 /a>   5"> 275 hmac4ref=                     arar_hda href="+code=asoarar_hdaclass="sref">asoc /a259">  href="+code=as259"> ref=et pair shared key3 and 3hen6" class="6ine" namn vL239"> 23_hdr6 cla3620f="net/sctp/auth.c#LLLLLLLLLLLLLLLLL-msizeof ef">ep_key /a>-/a>i 26/a>i        if (3a hre3="+6ef="+code6new" class="sre " claet/6ctp/a62h.c#L246" id v " claet/sctp/tp                 f="n  a href="+code=sc 248 /a>                                       tp                 f="n05 /a>        if (3a hre3="+6eatically6line" namn vL27classet/s6tp/au62t/sctc  struuf9" h href="+code= viet/sctp/auth.c#iss="  a0;/auth.c#L269" idiet/sctp/auth.c#iss=" =3ctpvL243"> 243 /a>n_parar4 /a>   5"> 275  _parar4ss=">/auth.c#L269" idiet/sctp/auth.c#iss="++esf">sctp_auth_bytes3/a> *3a h6ef="+code6len" class="sref">l3hdr"6clas362            struct  a href="+code= videt/sctp/auth.c#idth_c  aclasset/sctp/au toh4 /a>   5"> 275  toh4 id vclasset/sctp/auhmac4 /a>   5"> 275 hmac4ref=                    hmac_id4 /a>   5"> 275 hmac_id4ref=[auth.c#L269" idiet/sctp/auth.c#iss="]e> 225 /a>    bytes3/a> *3a h6e4="+code6fp" class="sref">gfpclas6et/sc62ef="n>param_hdr /a>. a3href=32re6= * given6s="sref"goro ="sref">mem6py /u6 href="+code=newut  a  ref="net/sct  Followf="nehecksic#Lidc naina>;i 2range">2ctp_random_param_t /a> *2a hre2="+6de=length6 class="sref">lengt3 /a>6i 243 /a>54" _lass_ /a>_ID_MAXet/sctp/auth.c#54" _lass_ /a>_ID_MAXref=edom_param_t /a> *2a hre2="+6d7e=chunk6called the two key vec/"6Figus62            struct  a   struc="ltinue> 225 /a>        return  a h6d8e=chunk6atenat/ng it to, it /sp 6/auth62dpoint pair shared key3 and 3hen68" class=6line" namn vL2o, it /sp 6184" 62a>,i *2a hre2="+6o see if 6he longer number is /sp*6 id v630f="net/sctp/auth.c#Lauth href="+code= vtp                 f="n                    a hrehmac4 /a>   5"> 275 a hrehmac4ref=[auth.c#L269" ididet/sctp/auth.c#idth_c]esf">sctp_auth_bytes3/a> *3a h6ero padde6.  If it is not, it /sp 63.h.c63" class="sref">offseytruct  a href="+code= v_assoc/at/o="sref">s2tp_hma                    default_hmac_idet/sctp/auth.c#default_hmac_id_hma  aclasset/sctp/auidet/sctp/auth.c#idth_c05 /a>        if (3a hre3="+6matically6larger numerically. /spA6GOctp63h.c#L265" id p_auth_mmmmmmmmmbreak> 225 /a>        return  a h6e called 6he two key vect, it /sp 63.ref63ef="net/sctp/auth.c#Lnumerically smalle3 key 35L26ed key ba6e op the paramn, it /sp 63.ctp63ef="net/sctp/et/sctp/auth.c#L250" id vL256e * given6  The algorithm, it /sp 63.p/a6th.c#eet/sctp/auth.c#L250" id vL256ee=length6the key vectors, it /sp 63.fol63f="net/sctp/auth.c#L223" id 327r6e7e=chunk6formed by selec, it /sp 63. cl63ef="net/sctp/auth.c#L237" id30L26r and con6atenat/ng it to, it /sp 63./sp63ti *2a hre2="+6o" class=6/ng the numeric, it /sp 6y. /s63a>,iiii 26/a>i           chunkhrf=,s" namn vL243"> 243 /a>     chunks_pararef="+code=peer"mn vLchunks_pararuct  a href="+code=scpararef="+code=peer"pararuct edom_param_t /a> *2a hre2="+6offset" c6ass="sref">offstisctp_auth_bytes3/a> *3a h6oro padde6uth_make_local_vector /a6(i<" 64h.c#L246" id unsignde=short=="sref">asoc /a259 href="+code=as259th_c05 /a>        if (3a hre3="+6oatically6fp" ass="sref">offstiasoc /afoundet/sctp/auth.c#foundth_c  a0;f">__u32 /a>  a href="+code6ref">sctp6auth_mak64"> 264 /a>    6     64            stru/auth.c#L269" idiet/sctp/auth.c#iss="> 225 /a>        return  a h6rd key ba6oc" clas65"> 265 /a>    6     64ef="n>param_hdr /a>. a3href=32re6ctor" cla6} else0 /a>        if ( 6 href64ef="net/sctp/> 17.c#L277" id vL27pararef="+code=peer"pararuct  ||/auth.c#L269" idpararef="+code=peer"pararuct                      arar_hda href="+code=asoarar_hdaclass="sref">asoc /a259">  href="+code=as259"> ref=   a0et/sctp/auth.c#L193" id 30co6ode=chunk6" class="sref">chunks / 6     6             struct  aruct  aref">__u32 /a>  a href="+code6r7e=chunk6ss="sref65"> 265 /a>    6     64ef="net/sctp/auth.c#L237" id30L26hunks" cl6"+code=len" class="sref"6len3e64ef="net/sctp/="sref">asoc /a259 href="+code=as259th_c  aclasset/sctp/au toh4 /a>   5"> 275  toh4 id vclasset/sctp/aupararef="+code=peer"pararuct                      arar_hda href="+code=asoarar_hdaclass="sref">asoc /a259">  href="+code=as259"> ref=e -msizeof ef">ep_key /a>-/a>i 26/a>i__u32 /a>  a href="+code6r" class=6LL" class="sref">NU3    6    364                      3     35de6offset" c6ass="sref">offs5"> 275 /6>i *2a hre2="+6ef">sctp_6uth_make_local_vector /a6(i<" 65257" id vL257" class="line" n /spaptmn">> 2nachunkctypenaaut INIT, INIT-ACK, SHUTDOWN-COMPLETE=snd lassctp_random_param_t /a> *2a hre2="+6eatically6memcpy /ua href="+code=n6wut  65uth.c#L258" id vL258" class="line" nmn">>chunks MUST NOTap caa 3e3aina>;i ctp_random_param_t /a> *2a hre2="+6eef">sctp6line" namn vL22kfree hre6="+co65net/sctp/autIfid vL255" class="/spaemn">>a>SHUTDOWN-COMPLETE=snd lass>chunks MUST p cignored3L261" class="line" namn 3L261"36ce6ef="+code6len" class="sref">l3"com6ent"365h.c#ef="net/sc, follow"line"et/schor*2ctp_random_param_t /a> *2a hre2="+6ede=chunk6ine" namn vL245"> 245 /66"> 2665="net/sctc  sf9" h href="+code= viet/sctp/auth.c#iss="  a0;/.c#L277" id vL27foundet/sctp/auth.c#foundth_c &r&r/auth.c#L269" idiet/sctp/auth.c#iss=" =3ctpvL243"> 243 /a>259 href="+code=as259th_c0/auth.c#L269" idiet/sctp/auth.c#iss="++esf">sctp_auth_bytes3/a> *3a h6hi"+code=6en" class="sref">len3men6"> * 65            struct  aswitch h href="+code= vpararef="+code=peer"pararuct                     chunks /a>           chunk4ref=[auth.c#L269" idiet/sctp/auth.c#iss="]esf">sctp_auth_bytes3/a> *3a h67" class=6line" namn vL227"> 3nt">6* 
 365ef="net/sctp/auth.c#LLLLLcasepvL243"> 243 /a>54" _CID_INITet/sctp/auth.c#54" _CID_INITf="nnet/sctp/auth.c#L232" id35L26e"+code=N6/ng the numeri82"> 182 /6>i,i 243 /a>54" _CID_INIT_ACKet/sctp/auth.c#54" _CID_INIT_ACKf="nnet/sctp/auth.c#L232" id35L26t of the 6oncatenat/op is tPopul/s6a="ne660f="net/sctp/auth.c#LLLLLcasepvL243"> 243 /a>54" _CID_SHUTDOWN_COMPLETEet/sctp/auth.c#54" _CID_SHUTDOWN_COMPLETEf="nnet/sctp/auth.c#L232" id35L26tf">sctp_6c/at/op shared koffseyLLLLcasepvL243"> 243 /a>54" _CID_lasset/sctp/auth.c#54" _CID_lassct"nnet/sctp/auth.c#L232" id35L26tatically6sulting two vectey. /spa6ti 225 /a>        return  a h6t" class=6ine" namn vL262"> 262 /a6s opy66sref">param_hdr /a>. a3href=32re6ode=ep_ke6" class="sref">ep_key /a6,ifirst_vector /a6,i           chunk4ref=[auth.c#L269" idiet/sctp/auth.c#iss="] = a href="+code=scchunk /a>           chunkhrf=et/sctp/auth.c#L193" id 30co6ector" cl6ss="sref">last_vector /a6,iasoc /afoundet/sctp/auth.c#foundth_c  a105 /a>        if (3a hre3="+6ef="+code6gfp" class="sref">gfp /a6)i 225 /a>        return  a h6t" class=6ine" namn vL267"> 267 /a6{isecret /a6;i,ioffset /a> = 6;iparam_hdr /a>. 3 href32 h6o*    ass6class="sref">auth_len /a6;i 271 /6>ilen /a6;iparam_hdr /a>. a3href=32re6ef="+code6key" class="sref">key /a6)i *2a hre2="+6ef="+code6len" class="sref">len /a6;i th_bsendacidet/sctp/auth.c#262"> th_bsendacid id vclasset/sctp/au/a>i 26/a>i           chunkhrf=,s="line" namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmaet/sctp/auth.c#L193" id 30co65" class=6line" namn vL275"> 275 /6>igfp /a>6;ii< th_benableet/sctp/auth.c#262"> th_benableuct  ||/.c#L277" id vL27_assoc/at/o="sref">s2tp_hma ||/.c#L277" id vL27_assoc/at/o="sref">s2tp_hma                       a href="+code=asoc" class="sref">asoc /aet /acapableet/sctp/auth.c#et /acapable_hmaet/sctp/auth.c#L193" id 30co65" class=6" class="sref">secret /a6)i__u32 /a>  a href="+code6ede=secre6LL" class="sref">NULL /a6;i 279 /6>i        struct  aauth.c#L276" id__/a>ii           chunkhrf=,sc#L277" id vL27_assoc/at/o="sref">s2tp_hma                       a href="+code=asoc" class="sref">asoc /a+co3nchunks /a>           +co3nchunksref=)ef">__u32 /a>  a href="+code6="+code=k6y" class="sref">key /a>)6{i * a hr6f="+c68/a> spap class="commen2"> * 2  a6 852.c#2t6er /spasctp_auth_create_6ey /#68net/sctp/autIfid vL255" cla="nehecksautwefruque 3e3avtp/8+co3fs iddasic3od8c" nachunk.=*2ctp_random_param_t /a> *2a hre2="+6=f="+code6class="sref">length ss="6omme268ef="nf=3+code34ref="+ vL262"> th_brecvacidet/sctp/auth.c#262"> th_brecvacid id vclasset/sctp/au/a>i 26/a>i           chunkhrf=,s="line" namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmaet/sctp/auth.c#L193" id 30co6e=length"6class="sref">le) {ii< th_benableet/sctp/auth.c#262"> th_benableuct  ||/.c#L277" id vL27_assoc/at/o="sref">s2tp_hmaet/sctp/auth.c#L193" id 30co6ef="+code6ine" namn vL226"> 22"> *6   T268            struct  aruct  aref">__u32 /a>  a href="+code6  class="6line" namn vL20) {iNULment6> * 268a>,iii           chunkhrf=,t pair shared key3 and 3hen6 the samn6 compare numbers */ /s266"> 26690f="net/sctp/auth.c#LLLLLLLLLLLLLLLv" namn vL243"> 243 /a>     chunks_pararef="+code=peer"mn vLchunks_pararuct  a) href="+code=sc 248 /a>                                       8 /a>           cclass="sref">asoc /aa hrechunks /a>           a hrechunksref=)ef">__u32 /a>  a href="+code6f="+code=6en" class="sref">len2"> 6    o69ef="nnumerically smalle3 key 35L26f="+code=6line" namn vL251"> 2vL196"> 1269/a> spap class="commen2"> * 2  a6e called 6he two key vec/">/* /spa6n /sp69net/sctp/autIfid vL255" cla="n54" -lass: Sespap  6.2:ctp_random_param_t /a> *2a hre2="+6ed key ba6e op the paramntesctp/au6h.c#L694" id vL184" class="line" namn">> 2nasendo3fMUST calcul3od=ic#L/a>Las deacribe3ainaRFC2104 [2] usingctp_random_param_t /a> *2a hre2="+6e=length"6  The algorithm ey. /spa6ti=ic#Lhash funspap  HLas deacribe3aby=ic#L/a>LIddasifio3fsass="3Lshare3href="net/sctp/auth.c#L233" id31ha6e" class=6class="comment"> */ /spa6ti=const struc key K basde=ona>;i<261" id  pairLshare3 key deacribe3abyhref="net/sctp/auth.c#L233" id31ha6ef="+code6" class="sref">ccccccccc6a hre69ef="nf="net/sc, follow"line"mn">=ic#Lshare3 key iddasifio3.>> 2na 241 data 241 8usedsf9" ic#Llloputstruc o ctp_random_param_t /a> *2a hre2="+6+code=hma6s" class="sref">>>>>>>>>6ecret69ti=ic#Llass-chunkc nagiven by=ic#Llass>chunk h.3" its  /a>Lfieldc"es toctp_random_param_t /a> *2a hre2="+6+"+code=N6ass="sref">peer_hmacs /a6ector69 vL18href=zero (aschunks vtp/8are place3href="net/sctp/auth.c#L233" id31ha7e=vector27 class="sref">vector3yte7" cla70sctp/auth.overlayclistlass=n*n">=cftercic#Llass>chunk ina>;i<54"  packet3L261" class="line" namn 3L261"36ce7ef="+code7ector /a>,i *2a hre2="+7ef="+code7ector /a>,ii th_bcalcul3od_hmac id v="line" namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef=7ef="+code7ector /a>,i 243 /a> k_buff                k_bufft  a href="+code=sctpskb                kb_hmac_algo_param_t /a>2* a h2ef=7e4="+code7e op the paramntesctp/au765"> 765 /a>                LLLLLLLLLLLLLL" namn vL243"> 243 /a> 62"> th_bchunk /a>            62"> th_bchunkt  a href="+code=sctp_u>  href="+code=as_u> _hmac_algo_param_t /a>2* a h2ef=7e5="+code7e The algorithm ey. /spa7ctp/a70ef="net/sctp/auth.c#LLLLLLLLLLLLLLLref="+code=sctpgfp" namn vL266"> 26gfp"                     gfpnamn vL266"> 26gfp_hmaet/sctp/auth.c#L193" id 30co7ode=chunk7tiector /a>,iccccccccc7;i 243 /a> 6atteraa 3et/sctp/auth.c#/aatteraa 3                    sget/sctp/auth.c#/gth_c> 225 /a>        return  a h7e8e=chunk7t" class="sref">>>>>>>>>7"+co370ef="net/sctp/" namn vL243"> 243 /a>hash_deacet/sctp/auth.c#hash_deac                    deacet/sctp/auth.c#deac    > 225 /a>        return  a h7e9e=chunk7tss="sref">peer_hmacs /a7Nowfw70a>,i           mn vL th_bbytest  a href="+code=sctp_ass_keyoc/at/o="sref">s2tp_key    > 225 /a>        return  a h7o see if 7he longer number is /sp*7184" 71ef="net/sctp/auth.c#L270" id__uthe key vecsref">__uth                    key_idet/sctp/auth.c#key_idhrf=,sc#L277" id vL27hmac_idet/sctp/auth.c#hmac_idref=> 225 /a>        return  a h7of="+code7.  If it is not, it /sp 73. 2s71h.c#L246" id v " claet/sctp/ vL8e key vecsref">__u8t  a href="+code=sctpdige 3et/sctp/auth.c#dige 3ref=> 225 /a>        return  a h7of="+code7larger numerically. /spA7GO 2s71ef="net/sctp/unsignde=char a href="+code=sctndet/sctp/auth.c#endth_c> 225 /a>        return  a h7of="+code7he two key vect, it /sp 73. 2s71            stru/               f46"_keyoc/at/o="sref">f46"_keyss="  a0; 225 /a>        return  a h7o4="+code7e op the paramn, it /sp 73. /s71ef="n>param_hdr /a>. a3href=32re7e5+code=a7  The algorithm, it /sp 73. /s71h.c#L265" id aref="net/sct  Followf="nExtract=ic#Linfotwefneed:ctp_random_param_t /a> *2a hre2="+7 keys and7the key vectors, it /sp 73. /s71w"line"et/s169" id *2a hre2="+7o9e=chunk7/ng the numeric, it /sp 7y. /s71nea hro buil auth.c#L276" idkey_idet/sctp/auth.c#key_idhrf=  aclasset/sctp/au toh4 /a>   5"> 275  toh4 id vclasset/sctp/au_u>  href="+code=as_u> _hma                    a hrehda href="+code=asa hrehdaclass="sref">asoc /ashkey_idet/sctp/auth.c#shkey_idref=)ef">__u32 /a>  a href="+code7" class="7ine" namn vL239"> 23_hdr7 cla372ef="net/sctp/auth.c#L270" idhmac_idet/sctp/auth.c#hmac_idref= =aclasset/sctp/au toh4 /a>   5"> 275  toh4 id vclasset/sctp/au_u>  href="+code=as_u> _hma                    a hrehda href="+code=asa hrehdaclass="sref">asoc /ahmac_idet/sctp/auth.c#hmac_idref=e05 /a>        if (3a hre3="+7ef="+code7new" class="sre " claet/7ctp/a72ef="net/sctp/auth.c#L271" id vL27eatically7line" namn vL27classet/s7tp/au72t/sctc  struu> 17auth.c#L276" idkey_idet/sctp/auth.c#key_idhrf=   a href="+code=sc 248 /a>                                       activ"_key_idet/sctp/auth.c#activ"_key_id_hmaet/sctp/auth.c#L193" id 30co7ef="+code7len" class="sref">l3hdr"7clas372            struct  a href="+code= v_ass_keyoc/at/o="sref">s2tp_key      a href="+code=sc 248 /a>                                       a     hare3_keyoc/at/o="sref">s2tp_ hare3_keyth_c> 225 /a>        return  a h7e4="+code7fp" class="sref">gfpclas7et/sc725 /a>        elsesf">sctp_auth_bytes3/a> *3a h7= * given7s="sref"goro ="sref">mem7py /u7 href="+code=newut  a vL265" class="line" namn vL hare3_keyoc/at/o="sref">mn vL hare3_keyt  a href="+code=sctpep_keyoc/at/o="sref">ep_keyth_c> 225 /a>        return  a h7ekeys and7 class="sref">lengt3 /a>7iep_keyth_c  a href="+code=scmn vL th_bget_shkey /a>           mn vL th_bget_shkey id vclasset/sctp/au_assoc/at/o="sref">s2tp_hmac auth.c#L276" idkey_idet/sctp/auth.c#key_idhrf=e05 /a>        if (3a hre3="+7e8e=chunk7atenat/ng it to, it /sp 7/auth72ef="net/sctp/auth.c#Lauth.c#L209" id vL20ep_keyoc/at/o="sref">ep_keyth_cet/sctp/auth.c#L193" id 30co7e9e=chunk7line" namn vL2o, it /sp 7184" 72a>,iparam_hdr /a>. 3 href32 h7ero padde7.  If it is not, it /sp 73.h.c73" class="sref">offsey href="+code= v_ass_keyoc/at/o="sref">s2tp_key      a href="+code=scmn vL th_bs2tp_cre3od_secre namn vL266"> 26/a>i< th_bs2tp_cre3od_secre  id vclasset/sctp/au_assoc/at/o="sref">s2tp_hmac auth.c#L276" idep_keyoc/at/o="sref">ep_keyth_cc auth.c#L276" idgfpnamn vL266"> 26gfp_hmae> 225 /a>        return  a h7oatically7larger numerically. /spA7GOctp73h.c#L265" id p_auth_m> 17.c#L277" id vL27_ass_keyoc/at/o="sref">s2tp_key    et/sctp/auth.c#L193" id 30co7e called 7he two key vect, it /sp 73.ref73ef="net/sctp/auth.c#Lppppppppruct  > 225 /a>        return  a h7o4="+code7e op the paramn, it /sp 73.ctp73ef="n>param_hdr /a>. a3href=32re7e * given7  The algorithm, it /sp 73.p/a73href="+code=newut  a                f46"_keyoc/at/o="sref">f46"_keyss="  a105 /a>        if (3a hre3="+7ee=length7the key vectors, it /sp 73.fol73ef="net/sctp/numerically smalle3 key 35L27e7e=chunk7formed by selec, it /sp 73. cl73ef="net/sctp/auth.c#L237" id30L27r and con7atenat/ng it to, it /sp 73./sp738.c#L265" id aref="net/sct  Followf="n"es up /aattercaa 3nw2ctp_random_param_t /a> *2a hre2="+7o" class=7/ng the numeric, it /sp 7y. /s73nea hro buil auth.c#L276" idtndet/sctp/auth.c#endth_c  a href="+code=scmkb_tail_" id  a href="+code=asmkb_tail_" id  a id vclasset/sctp/au/kb                kb_hmae> 225 /a>        return  a h7offset" c7ass="sref">offstiep_key /a>-/get/sctp/auth.c#/gth_c,sc#L277" id vL27_u>  href="+code=as_u> _hmac auth.c#L276" idtndet/sctp/auth.c#endth_c - (unsignde=char a) href="+code=sc u>  href="+code=as_u> _hmae> 225 /a>        return  a h7oro padde7uth_make_local_vector /a7(i<" 74ef="net/sctp/auth.c#L271" id vL27oatically7fp" ass="sref">offstiasoc /atfref="+code=peer"tfr      a href="+code=sc 248 /a>                                       tp                 f="n                    a hrehmac4 /a>   5"> 275 a hrehmac4ref=[auth.c#L269" idhmac_idet/sctp/auth.c#hmac_idref=]05 /a>        if (3a hre3="+7ref">sctp7auth_mak64"> 264 /a>    7     74            s               deacet/sctp/auth.c#deac    s="sref">asoc /aflag4 /a>   5"> 275 flag4ss="  a0; 225 /a>        return  a h7rd key ba7oc" clas65"> 265 /a>    7     74ef="n>param_hdr /a>. a3href=32re7ctor" cla7} else0 /a>        if ( 7 href74h.c#L265" id auth.c#L276" iddige 3et/sctp/auth.c#dige 3ref=  a href="+code=sc u>  href="+code=as_u> _hma                    a hrehda href="+code=asa hrehdaclass="sref">asoc /ahmacet/sctp/auth.c#hmacth_c> 225 /a>        return  a h7ode=chunk7" class="sref">chunks / 7     74ef="net/sctp/authref="+code=sctpcrypto_hash_"eskeyoc/at/o="sref">crypto_hash_"eskey id vclasset/sctp/audeacet/sctp/auth.c#deac    s="sref">asoc /atfref="+code=peer"tfr    ,a&ref">ep_key /a>-_ass_keyoc/at/o="sref">s2tp_key                        dataet/sctp/auth.c#dataref=[0],sc#L277" id vL27_ass_keyoc/at/o="sref">s2tp_key                        259 href="+code=as259th_c)et/sctp/auth.c#L193" id 30co7r7e=chunk7ss="sref65"> 265 /a>    7     7             struct  agoto                f46"oc/at/o="sref">f46"th_c> 225 /a>        return  a h7o and con7"+code=len" class="sref"7len3e74dpoint pair shared key3 and 3hen7r" class=7LL" class="sref">NU3    7    374nea hro buil auth.c#L276" idcrypto_hash_dige 3et/sctp/auth.c#crypto_hash_dige 3 id v&ref">ep_key /a>-deacet/sctp/auth.c#deac    ,a&ref">ep_key /a>-/get/sctp/auth.c#/gth_c,sc#L277" id vL27/get/sctp/auth.c#/gth_cs="sref">asoc /a259">  href="+code=as259"> ref=,sc#L277" id vL27dige 3et/sctp/auth.c#dige 3ref=e> 225 /a>        return  a h7offset" c7ass="sref">offs5"> 275 /7>iparam_hdr /a>. 3 href32 h7ef">sctp_7uth_make_local_vector /a7(i<" 75257" i              f46"oc/at/o="sref">f46"th_cnet/sctp/auth.c#L232" id35L27eatically7memcpy /ua href="+code=n7wut  75t/sctc  struu> 17auth.c#L276" idf46"_keyoc/at/o="sref">f46"_keyss="et/sctp/auth.c#L193" id 30co7eef">sctp7line" namn vL22kfree hre7="+co75            struct  a href="+code= v/a>i< th_bkey_pu namn vL266"> 26/a>i< th_bkey_pu  id vclasset/sctp/au_ass_keyoc/at/o="sref">s2tp_key    e> 225 /a>        return  a h7od key ba7line" namn vL21kfree hre7="+co754" idnumerically smalle3 key 35L27ef="+code7len" class="sref">l3"com7ent"375h.c#eumerically smalle3 key 35L27ede=chunk7ine" namn vL245"> 245 /67"> 2675w"line"et/s169" id *2a hre2="+7hi"+code=7en" class="sref">len3men7"> * 75ef="net/sctp/auth.c#L237" id30L277" class=7line" namn vL227"> 3nt">7* 
 375ti;i<261" id  s iddasic3oddachunkcaa 3nw2ctp_random_param_t /a> *2a hre2="+7e"+code=N7/ng the numeri82"> 182 /7>i,i th_be"> ddbchunkidet/sctp/auth.c#262"> th_be"> ddbchunkid id v" namn vL243"> 243 /a>     261" id sref">sctp_auan href261" id uct  a href="+code=sctp                 f="n,sclasset/sctp/au__L8e key vecsref">__u8t  a auth.c#L276" idchunk_idet/sctp/auth.c#chunk_idss="et/sctp/auth.c#L193" id 30co7t of the 7oncatenat/op is tPopul/s7a="ne76="sref">sctp_auth_bytes3/a> *3a h7tf">sctp_7c/at/op shared k 243 /a>     chunks_pararef="+code=peer"mn vLchunks_pararuct  a href="+code=scpef="+code=peer" f="n  a href="+code=sctp                 f="n                    a hrechunk_aa 3et/sctp/auth.c#a hrechunk_aa 3th_c> 225 /a>        return  a h7tatically7sulting two vectey. /spa7ti__uth                    nchunks /a>           nchunksref=> 225 /a>        return  a h7tef">sctp7ine" namn vL262"> 262 /a7s opy76            s               __uthe key vecsref">__uth                    oarar_259 href="+code=asoarar_259ref=> 225 /a>        return  a h7td key ba7" class="sref">ep_key /a7,ifirst_vector /a7,i *2a hre2="+7ector" cl7ss="sref">last_vector /a7,iiigfp /a7)i__u32 /a>  a href="+code7t" class=7ine" namn vL267"> 267 /a7{isecret /a7;i,i *2a hre2="+7offset" c7ass="sref">offset /a> = 7;i 275  toh4 id vclasset/sctp/aupef="+code=peer" f="n                     arar_hda href="+code=asoarar_hdaclass="sref">asoc /a259">  href="+code=as259"> ref=eef">__u32 /a>  a href="+code7o*    ass7class="sref">auth_len /a7;i           nchunksref=  aclasset/sctp/auoarar_259 href="+code=asoarar_259ref= -msizeof ef">ep_key /a>-/a>i 26/a>i__u32 /a>  a href="+code7o.  The r7line" namn vL271"> 271 /7>i 17auth.c#L276" idnchunks /a>           nchunksref=   aclasset/sctp/au54" _NUM_CHUNK_TYPES /a>           54" _NUM_CHUNK_TYPESss="et/sctp/auth.c#L193" id 30co7ef="+code7len" class="sref">len /a7;i           EINVALref=> 225 /a>        return  a h7ef="+code7key" class="sref">key /a7)ilen /a7;i           nchunksref=]  aclasset/sctp/auchunk_idet/sctp/auth.c#chunk_idss="> 225 /a>        return  a h7ector" cl7line" namn vL275"> 275 /7>iasoc /a259">  href="+code=as259"> ref=  aclasset/sctp/auhton4 /a>   5"> 275 hton4 id vclasset/sctp/auparar_259 href="+code=asoarar_259ref= + 1)ef">__u32 /a>  a href="+code7of="+code7fp" class="sref">gfp /a>7;i__u32 /a>  a href="+code75" class=7" class="sref">secret /a7)iNULL /a7;i 279 /7>i;i<261" id  aa 3nof 2hmac i3snw2ctp_random_param_t /a> *2a hre2="+7="+code=k7y" class="sref">key /a>)7{i th_be"> et_hmac4 /a>   5"> 275 262"> th_be"> et_hmac4 id v" namn vL243"> 243 /a>     261" id sref">sctp_auan href261" id uct  a href="+code=sctp                 f="n,dom_param_t /a> *2a hre2="+7=.  The r7tp_auth_bytes /a> * a hr7f="+c78h.c#L265" id p_auth_mmmmmmmmmref" namn vL243"> 243 /a>     hmac193"sref">sctp_auan hrefhmac193"uct  a href="+code=schmac4 /a>   5"> 275 hmac4ref=et/sctp/auth.c#L193" id 30co7 852.c#2t7er /spasctp_auth_create_7ey /#78net/sf">sctp_auth_bytes3/a> *3a h7=f="+code7class="sref">length ss="7omme2785 /a>        f=3+code34ref="+ vLhasL ha1 /a>   5"> 275 hasL ha1ss="  a0; 225 /a>        return  a h7e=length"7class="sref">le) {i__uth                    idet/sctp/auth.c#idth_c05 /a>        if (3a hre3="+7 " class=7line" namn vL27ref="+cod7=sctp78ef="net/sctp/aru/auth.c#L269" idiet/sctp/auth.c#iss="> 225 /a>        return  a h7ef="+code7ine" namn vL226"> 22"> *7   T278ef="net/sctp/auth.c#L237" id30L27  class="7line" namn vL20) {i;i 2id9">Also maki *2a hre2="+7=de=secre7LL" class="sref">NULment7> * 278 vL18href 2679sctp/auth.overlayclistlass=n"""""""""2ctp_random_param_t /a> *2a hre2="+7f="+code=7en" class="sref">len2"> 7    o79h.c#L246" id f9" h href="+code= viet/sctp/auth.c#iss="  a0;/auth.c#L269" idiet/sctp/auth.c#iss=" =3ctpvL243"> 243 /a>hmac4 /a>   5"> 275 hmac4ref=                    shmac_num_i3das4 /a>   5"> 275 2hmac_num_i3das4ss=">/auth.c#L269" idiet/sctp/auth.c#iss="++esf">sctp_auth_bytes3/a> *3a h7f="+code=7line" namn vL251"> 2vL197"> 1279h.c#L265" id p_auth_m               idet/sctp/auth.c#idth_c  aclasset/sctp/auhmac4 /a>   5"> 275 hmac4ref=                    shmac_i3das4 /a>   5"> 275 2hmac_i3das4ss="[auth.c#L269" idiet/sctp/auth.c#iss="]> 225 /a>        return  a h7e called 7he two key vec/">/* /spa7n /sp79sref">param_hdr /a>. a3href=32re7ed key ba7e op the paramntesctp/au7h.c#L795 /a>                authref="+code=sctpidet/sctp/auth.c#idth_ce=gctpvL243"> 243 /a>54" _lass_ /a>_ID_MAXet/sctp/auth.c#54" _lass_ /a>_ID_MAXref=edom_param_t /a> *2a hre2="+7e=length"7  The algorithm ey. /spa7ti 225 /a>        return  a h7e" class=7class="comment"> */ /spa7ticcccccccc7a hre79            struct  aauthref="+code=sctp54" _lass_ /a>_ID_SHA1et/sctp/auth.c#54" _lass_ /a>_ID_SHA1ref=   aclasset/sctp/auidet/sctp/auth.c#idth_cedom_param_t /a> *2a hre2="+7e class="7s" class="sref">>>>>>>>>7ecret79ef="net/sctp/auth.c#LLLLLLLLLcode34ref="+ vLhasL ha1 /a>   5"> 275 hasL ha1ss="  a105 /a>        if (3a hre3="+7+"+code=N7ass="sref">peer_hmacs /a7ector79                      3     35de8e=vector28 class="sref">vector3yte8" cla800f="net/sctp/auth.c#Lauth.c#L209" id vL20/a>iiasoc /ahmac_tor3 /a>   5"> 275 hmac_tor3th_cedom_param_t /a> *2a hre2="+8ef="+code8ector /a>,ioffseytruct  aruct  a-classet/sctp/auEOPNOTSUPP /a>           EOPNOTSUPPss="> 225 /a>        return  a h8ef="+code8ector /a>,iparam_hdr /a>. a3href=32re8e4="+code8e op the paramntesctp/au865"> 865 /a>        auth.c#L209" id vL20hasL ha1 /a>   5"> 275 hasL ha1ss="edom_param_t /a> *2a hre2="+8e5="+code8e The algorithm ey. /spa8ctp/a80ef="net/sctp/auth.c#Lruct  a-classet/sctp/auEINVAL /a>           EINVALref=> 225 /a>        return  a h8ode=chunk8tiector /a>,iccccccccc8;imemcpy id vclasset/sctp/autp                 f="n                    a hrehmac4_aa 3et/sctp/auth.c#a hrehmac4_aa 3f="n                    hmac_id4 /a>   5"> 275 hmac_id4ref=,a&ref">ep_key /a>-hmac4 /a>   5"> 275 hmac4ref=                    shmac_i3das4 /a>   5"> 275 2hmac_i3das4ss="[0],dom_param_t /a> *2a hre2="+8e8e=chunk8t" class="sref">>>>>>>>>8"+co380ef="net/sctp/auth.c#LvL243"> 243 /a>hmac4 /a>   5"> 275 hmac4ref=                    shmac_num_i3das4 /a>   5"> 275 2hmac_num_i3das4ss="""nsizeof ef">ep_key /a>-__uthe key vecsref">__uth    ))ef">__u32 /a>  a href="+code8e9e=chunk8tss="sref">peer_hmacs /a8Nowfw80nea hro buil auth.c#L276" idtp                 f="n                    a hrehmac4_aa 3et/sctp/auth.c#a hrehmac4_aa 3f="n                     arar_hda href="+code=asoarar_hdaclass="sref">asoc /a259">  href="+code=as259"> ref=  aclasset/sctp/auhton4 /a>   5"> 275 hton4 id vsizeof ef">ep_key /a>-/a>i 26/a>i__u32 /a>  a href="+code8o see if 8he longer number is /sp*8184" 810f="net/sctp/auth.c#LLLLLLLLLLLLLLL#LvL243"> 243 /a>hmac4 /a>   5"> 275 hmac4ref=                    shmac_num_i3das4 /a>   5"> 275 2hmac_num_i3das4ss="""nsizeof ef">ep_key /a>-__uthe key vecsref">__uth    ))ef">__u32 /a>  a href="+code8of="+code8.  If it is not, it /sp 83. 2s81" class="srefruct  a0; 225 /a>        return  a h8of="+code8larger numerically. /spA8GO 2s81ef="nnumerically smalle3 key 35L28of="+code8he two key vect, it /sp 83. 2s81sref">param_hdr /a>. a3href=32re8o4="+code8e op the paramn, it /sp 83. /s814" id vL184" class="line" n="nSet a newLshare3 key on either<261" id  or=const struc. nIf  cectp_random_param_t /a> *2a hre2="+8e5+code=a8  The algorithm, it /sp 83. /s81h.c#ef="net/sc, follow"line"mn>;i;i *2a hre2="+8ede=chunk8the key vectors, it /sp 83. /s81w"line"et/s169" id *2a hre2="+8e8e=chunk8atenat/ng it to, it /sp 83. /s81ti th_bset_keyoc/at/o="sref">mn vL th_bset_key id v" namn vL243"> 243 /a>     261" id sref">sctp_auan href261" id uct  a href="+code=sctp                 f="n,dom_param_t /a> *2a hre2="+8o9e=chunk8/ng the numeric, it /sp 8y. /s81a>,i 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef=8" class="8ine" namn vL239"> 23_hdr8 cla3820f="net/sctp/auth.c#LLLLLLLvL265" class="line" namn vL th_keyoc/at/o="sref">mn vL th_keyt  a href="+code=sctp th_bkeyet/sctp/auth.c#a hrekeyss="et/sctp/auth.c#L193" id 30co8ef="+code8new" class="sre " claet/8ctp/a82ef="nf">sctp_auth_bytes3/a> *3a h8eatically8line" namn vL27classet/s8tp/au82t/sctc  struuvL265" class="line" namn vL hare3_keyoc/at/o="sref">mn vL hare3_keyt  a href="+code=sctpcur_keyoc/at/o="sref">cur_keyref=  aclasset/sctp/auNULL /a>           NULLref=> 225 /a>        return  a h8ef="+code8len" class="sref">l3hdr"8clas382            svL265" class="line" namn vL th_bbytes /a>           mn vL th_bbytest  a href="+code=sctpkeyoc/at/o="sref">keyth_c> 225 /a>        return  a h8e4="+code8fp" class="sref">gfpclas8et/sc825 /a>        vL265" class="line" naaa 3_head href="+code=as2a 3_headt  a href="+code=sctpsrekey4 /a>   5"> 275 2hekey4th_c> 225 /a>        return  a h8e5+code=a8s="sref"goro ="sref">mem8py /u8 href="+code=nf=3+code34ref="+ vLruplace /a>   5"> 275 ruplacess="  a0; 225 /a>        return  a h8ekeys and8 class="sref">lengt3 /a>8i *2a hre2="+8e8e=chunk8atenat/ng it to, it /sp 8/auth82ti *2a hre2="+8e9e=chunk8line" namn vL2o, it /sp 8184" 82 vL18href *2a hre2="+8o see if 8he longer number is /sp*8 id v830f="net/sctp/authref="+code=sctp_assoc/at/o="sref">s2tp_hmaet/sctp/auth.c#L193" id 30co8ero padde8.  If it is not, it /sp 83.h.c83" class="sref">offsey href="+code= vsrekey4 /a>   5"> 275 2hekey4th_c  a&ref">ep_key /a>-_assoc/at/o="sref">s2tp_hma                    t61" id L hare3_key4 /a>   5"> 275 t61" id L hare3_key4th_c> 225 /a>        return  a h8oatically8larger numerically. /spA8GOctp83h.c#L265" id else 225 /a>        return  a h8of="+code8he two key vect, it /sp 83.ref83ef="net/sctp/auth.c#L href="+code= vsrekey4 /a>   5"> 275 2hekey4th_c  a&ref">ep_key /a>-tp                 f="n                    t61" id L hare3_key4 /a>   5"> 275 t61" id L hare3_key4th_c> 225 /a>        return  a h8o4="+code8e op the paramn, it /sp 83.ctp83ef="n>param_hdr /a>. a3href=32re8e * given8  The algorithm, it /sp 83.p/a83h.c#L265" id auth.c#L276" idkey_for_eac  href="+code=askey_for_eac  id vclasset/sctp/aucur_keyoc/at/o="sref">cur_keyref=,sc#L277" id vL27/rekey4 /a>   5"> 275 2hekey4th_cesf">sctp_auth_bytes3/a> *3a h8ee=length8the key vectors, it /sp 83.fol83            struct  aauthref="+code=sctpcur_keyoc/at/o="sref">cur_keyref=                    key_idet/sctp/auth.c#key_idhrf=   a href="+code=sc th_bkeyet/sctp/auth.c#a hrekeyss="                    scaekeynumb a href="+code=asmcaekeynumb ath_cesf">sctp_auth_bytes3/a> *3a h8e7e=chunk8formed by selec, it /sp 83. cl83            struct  a   struccode34ref="+ vLruplace /a>   5"> 275 ruplacess="  a105 /a>        if (3a hre3="+8r and con8atenat/ng it to, it /sp 83./sp83ef="net/sctp/auth.c#LLLLLLLLLbreak> 225 /a>        return  a h8o" class=8/ng the numeric, it /sp 8y. /s83a>,ioffstioffsti *2a hre2="+8ref">sctp8auth_mak64"> 264 /a>    8     84net/sctp/autIfid vL255" class="/spaemnaLshare3 key3L261" class="line" namn 3L261"36ce8rd key ba8oc" clas65"> 265 /a>    8     844" id vL184" class="line" nas="/spaem2ctp_random_param_t /a> *2a hre2="+8ctor" cla8} else0 /a>        if ( 8 href84h.c#L265" id auth.c#L209" id vL20ruplace /a>   5"> 275 ruplacess="esf">sctp_auth_bytes3/a> *3a h8ode=chunk8" class="sref">chunks / 8     84            struct  aref="+code=sctpcur_keyoc/at/o="sref">cur_keyref=  aclasset/sctp/aumn vL th_bshkey_cre3odoc/at/o="sref">mn vL th_bshkey_cre3od id vclasset/sctp/au th_bkeyet/sctp/auth.c#a hrekeyss="                    scaekeynumb a href="+code=asmcaekeynumb ath_cc_algo_param_t /a>2* a h2ef=8r7e=chunk8ss="sref65"> 265 /a>    8     8             struct  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa               GFP_KERNEL /a>           GFP_KERNELss="e> 225 /a>        return  a h8o and con8"+code=len" class="sref"8len3e84ef="net/sctp/auth.c#Lauth.c#L209" id vL20cur_keyoc/at/o="sref">cur_keyref=et/sctp/auth.c#L193" id 30co8r" class=8LL" class="sref">NU3    8    384a>,ioffs5"> 275 /8>isctp_8uth_make_local_vector /a8(i<" 85ef="net/sctp/auth.c#L271" id vL28eatically8memcpy /ua href="+code=n8wut  85ef="net/sctp/ ref="net/sct  Followf="nCre3odsafnewLkey data basde=ona>;i *2a hre2="+8eef">sctp8line" namn vL22kfree hre8="+co85            sref="+code=sctpkeyoc/at/o="sref">keyth_c  aclasset/sctp/aumn vL th_bcre3od_keyoc/at/o="sref">mn vL th_bcre3od_key id vclasset/sctp/au th_bkeyet/sctp/auth.c#a hrekeyss="                    scaekey259">  href="+code=asscaekey259"> ref=,sc#L277" id vL27GFP_KERNEL /a>           GFP_KERNELss="e> 225 /a>        return  a h8od key ba8line" namn vL21kfree hre8="+co855 /a>        auth.c#L209" id vL20keyoc/at/o="sref">keyth_cet/sctp/auth.c#L193" id 30co8ef="+code8len" class="sref">l3"com8ent"385ef="net/sctp/auth.c#Lgoto                nomeref="+code=peer"nomerth_c> 225 /a>        return  a h8ode=chunk8ine" namn vL245"> 245 /68"> 2685f="net/sctp/auth.c#L223" id 327r8hi"+code=8en" class="sref">len3men8"> * 85            sclasset/sctp/aumemcpyoc/at/o="sref">memcpy id vclasset/sctp/aukeyoc/at/o="sref">keyth_c                    dataet/sctp/auth.c#dataref=,a&ref">ep_key /a>-_th_bkeyet/sctp/auth.c#a hrekeyss="                    scaekey href="+code=asscaekeyss="[0],a href="+code=sc th_bkeyet/sctp/auth.c#a hrekeyss="                    scaekey259">  href="+code=asscaekey259"> ref=e> 225 /a>        return  a h8o and con8line" namn vL227"> 3nt">8* 
 385dpoint pair shared key3 and 3hen8e"+code=N8/ng the numeri82"> 182 /8>i,i;ictp_random_param_t /a> *2a hre2="+8tf">sctp_8c/at/op shared ksctp8ine" namn vL262"> 262 /a8s opy86            sauthref="+code=sctpruplace /a>   5"> 275 ruplacess="edom_param_t /a> *2a hre2="+8td key ba8" class="sref">ep_key /a8,i                classet/sctp/aumn vL th_bkey_pu namn vL266"> 26/a>i< th_bkey_pu  id vclasset/sctp/aucur_keyoc/at/o="sref">cur_keyref=                    keyoc/at/o="sref">keyth_ce> 225 /a>        return  a h8tf="+code8s="sref">first_vector /a8,i        return  a h8ector" cl8ss="sref">last_vector /a8,iep_key /a>-cur_keyoc/at/o="sref">cur_keyref=                    key_aa 3et/sctp/auth.c#key_aa 3ref=,sc#L277" id vL27/rekey4 /a>   5"> 275 2hekey4th_ce> 225 /a>        return  a h8ti"+code=8gfp" class="sref">gfp /a8)i 267 /a8{icur_keyref=                    keyoc/at/o="sref">keyth_c  aclasset/sctp/aukeyoc/at/o="sref">keyth_c> 225 /a>        return  a h8ode=secre8" class="sref">secret /a8;i,i 26/a>i< th_bkey_hol3 id vclasset/sctp/aukeyoc/at/o="sref">keyth_ce> 225 /a>        return  a h8offset" c8ass="sref">offset /a> = 8;iparam_hdr /a>. 3 href32 h8o*    ass8class="sref">auth_len /a8;i 271 /8>ilen /a8;i   5"> 275 ruplacess="eet/sctp/auth.c#L232" id35L28ed key ba8key" class="sref">key /a8)i                classet/sctp/aumn vL th_bshkey_f46"oc/at/o="sref">mn vL th_bshkey_f46" id vclasset/sctp/aucur_keyoc/at/o="sref">cur_keyref=e> 225 /a>        return  a h8of="+code8len" class="sref">len /a8;i 275 /8>igfp /a>8;isecret /a8)iNULL /a8;i,i th_bset_activ"_keyoc/at/o="sref">mn vL th_bset_activ"_key id v" namn vL243"> 243 /a>     261" id sref">sctp_auan href261" id uct  a href="+code=sctp                 f="n,dom_param_t /a> *2a hre2="+89" class=8line" namn vL279"> 279 /8>i 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef=8="+code=k8y" class="sref">key /a>)8{ioffseytruct  a     classet/sctp/au__uthe key vecsref">__uth      auth.c#L276" idkey_idet/sctp/auth.c#key_idhrf=e_algo_param_t /a>2* a h2ef=8=.  The r8tp_auth_bytes /a> * a hr8f="+c88h.c#Lf">sctp_auth_bytes3/a> *3a h8 852.c#2t8er /spasctp_auth_create_8ey /#88            svL265" class="line" namn vL hare3_keyoc/at/o="sref">mn vL hare3_keyt  a href="+code=sctpkeyoc/at/o="sref">keyth_c> 225 /a>        return  a h8=f="+code8class="sref">length ss="8omme2885 /a>        vL265" class="line" naaa 3_head href="+code=as2a 3_headt  a href="+code=sctpsrekey4 /a>   5"> 275 2hekey4th_c> 225 /a>        return  a h8e=length"8class="sref">le) {i 22"> *8   T288            s vL184" class="line" n="nT;i *2a hre2="+8  class="8line" namn vL20) {is2tp_hmaet/sctp/auth.c#L193" id 30co8=de=secre8LL" class="sref">NULment8> * 288a>,i   5"> 275 2hekey4th_c  a&ref">ep_key /a>-_assoc/at/o="sref">s2tp_hma                    t61" id L hare3_key4 /a>   5"> 275 t61" id L hare3_key4th_c> 225 /a>        return  a h8 the samn8 compare numbers */ /s268"> 26890f="net/sctp/else 225 /a>        return  a h8f="+code=8en" class="sref">len2"> 8    o89" class="sref">offsey href="+code= vsrekey4 /a>   5"> 275 2hekey4th_c  a&ref">ep_key /a>-tp                 f="n                    t61" id L hare3_key4 /a>   5"> 275 t61" id L hare3_key4th_c> 225 /a>        return  a h8f="+code=8line" namn vL251"> 2vL198"> 1289h.c#L 225 /a>        return  a h8f852.c#2t8he two key vec/">/* /spa8n /sp89            sref="+code=sctpkey_for_eac  href="+code=askey_for_eac  id vclasset/sctp/aukeyoc/at/o="sref">keyth_c,sc#L277" id vL27/rekey4 /a>   5"> 275 2hekey4th_cesf">sctp_auth_bytes3/a> *3a h8ed key ba8e op the paramntesctp/au8h.c#L895 /a>                authref="+code=sctpkeyoc/at/o="sref">keyth_c                    key_idet/sctp/auth.c#key_idhrf=   a href="+code=sckey_idet/sctp/auth.c#key_idhrf=esf">sctp_auth_bytes3/a> *3a h8e=length"8  The algorithm ey. /spa8ti */ /spa8ti 225 /a>        return  a h8ef="+code8" class="sref">ccccccccc8a hre89            struct  anumerically smalle3 key 35L28e class="8s" class="sref">>>>>>>>>8ecret89ef="net/sctp/numerically smalle3 key 35L28ede=secre8ass="sref">peer_hmacs /a8ector89                      3     35de9e=vector29 class="sref">vector3yte9" cla900f="net/sctp/auth.c#L209" id vL20foundet/sctp/auth.c#foundss="et/sctp/auth.c#L193" id 30co9ef="+code9ector /a>,ioffseyruct  a-classet/sctp/auEINVAL /a>           EINVALref=> 225 /a>        return  a h9ef="+code9ector /a>,i,is2tp_hmaesf">sctp_auth_bytes3/a> *3a h9e4="+code9e op the paramntesctp/au965"> 905 /a>                classet/sctp/au 248 /a>                                       activ"_key_idet/sctp/auth.c#activ"_key_id_hma  aclasset/sctp/aukey_idet/sctp/auth.c#key_idhrf=> 225 /a>        return  a h9e5="+code9e The algorithm ey. /spa9ctp/a90ef="net/sctp/auth.c#Lcode34ref="+ vL262"> th_bs2tp_init_activ"_keyoc/at/o="sref">mn vL th_bs2tp_init_activ"_key id vclasset/sctp/au assoc/at/o="sref">s2tp_hmac auth.c#L276" idGFP_KERNEL /a>           GFP_KERNELss="e> 225 /a>        return  a h9ode=chunk9tiector /a>,iccccccccc9;i 225 /a>        return  a h9e8e=chunk9t" class="sref">>>>>>>>>9"+co390dpoint pair shared key3 and 3hen9e9e=chunk9tss="sref">peer_hmacs /a9Nowfw90nea hro buil ruct  a0; 225 /a>        return  a h9o see if 9he longer number is /sp*9184" 910f="nnumerically smalle3 key 35L29of="+code9.  If it is not, it /sp 93. 2s91ef="net/sctp/auth.c#L271" id vL29of="+code9larger numerically. /spA9GO 2s91ef="nf=3+code34ref="+ vL262"> th_bdel_key_idet/sctp/auth.c#262"> th_bdel_key_id id v" namn vL243"> 243 /a>     261" id sref">sctp_auan href261" id uct  a href="+code=sctp                 f="n,dom_param_t /a> *2a hre2="+9of="+code9he two key vect, it /sp 93. 2s91ef="net/sctp/auth.c#LppppppppL" namn vL243"> 243 /a>                                    const struct  a href="+code=sctp_assoc/at/o="sref">s2tp_hmac_algo_param_t /a>2* a h2ef=9o4="+code9e op the paramn, it /sp 93. /s915 /a>                struct  aref="+code=sctp__uthe key vecsref">__uth      auth.c#L276" idkey_idet/sctp/auth.c#key_idhrf=e_algo_param_t /a>2* a h2ef=9e5+code=a9  The algorithm, it /sp 93. /s91h.c#ef">sctp_auth_bytes3/a> *3a h9ede=chunk9the key vectors, it /sp 93. /s91ef="net/sctp/vL265" class="line" namn vL hare3_keyoc/at/o="sref">mn vL hare3_keyt  a href="+code=sctpkeyoc/at/o="sref">keyth_c> 225 /a>        return  a h9e7e=chunk9formed by selec, it /sp 93. /s917f="net/sctp/vL265" class="line" naaa 3_head href="+code=as2a 3_headt  a href="+code=sctpsrekey4 /a>   5"> 275 2hekey4th_c> 225 /a>        return  a h9e8e=chunk9atenat/ng it to, it /sp 93. /s918.c#L265" id a=3+code34ref="+ vLfoundet/sctp/auth.c#foundss="  a0; 225 /a>        return  a h9o9e=chunk9/ng the numeric, it /sp 9y. /s91                      3     35de9" class="9ine" namn vL239"> 23_hdr9 cla3920f="net/sctp/ vL184" class="line" n="nT;i *2a hre2="+9ef="+code9new" class="sre " claet/9ctp/a92i *2a hre2="+9ef="+code9line" namn vL27classet/s9tp/au92ef="n vL184" class="line" nas="/spaem2ctp_random_param_t /a> *2a hre2="+9ef="+code9len" class="sref">l3hdr"9clas392            sauthref="+code=sctp_assoc/at/o="sref">s2tp_hmaesf">sctp_auth_bytes3/a> *3a h9e4="+code9fp" class="sref">gfpclas9et/sc925 /a>                authref="+code=sctp 248 /a>                                       activ"_key_idet/sctp/auth.c#activ"_key_id_hma   a href="+code=sckey_idet/sctp/auth.c#key_idhrf=e">sctp_auth_bytes3/a> *3a h9e5+code=a9s="sref"goro ="sref">mem9py /u92ef="net/sctp/auth.c#LLLLLLLLLruct  a-classet/sctp/auEINVAL /a>           EINVALref=> 225 /a>        return  a h9ekeys and9 class="sref">lengt3 /a>9i 275 2hekey4th_c  a&ref">ep_key /a>-_assoc/at/o="sref">s2tp_hma                    t61" id L hare3_key4 /a>   5"> 275 t61" id L hare3_key4th_c> 225 /a>        return  a h9e8e=chunk9atenat/ng it to, it /sp 9/auth92ef="net/sctp/n/elsesf">sctp_auth_bytes3/a> *3a h9e9e=chunk9line" namn vL2o, it /sp 9184" 92a>,isctp_auth_bytes3/a> *3a h9o see if 9he longer number is /sp*9 id v930f="net/sctp/auth.c#LLLLLLLLLruct  a-classet/sctp/auEINVAL /a>           EINVALref=> 225 /a>        return  a h9ero padde9.  If it is not, it /sp 93.h.c93ef="net/sctp/auth.c#L271" id vL29oatically9larger numerically. /spA9GOctp93h.c#L265" id p_auth_m               srekey4 /a>   5"> 275 2hekey4th_c  a&ref">ep_key /a>-tp                 f="n                    t61" id L hare3_key4 /a>   5"> 275 t61" id L hare3_key4th_c> 225 /a>        return  a h9of="+code9he two key vect, it /sp 93.ref93ef="net/sctp/numerically smalle3 key 35L29o4="+code9e op the paramn, it /sp 93.ctp93ef="n>param_hdr /a>. a3href=32re9e * given9  The algorithm, it /sp 93.p/a93h.c#L265" id auth.c#L276" idkey_for_eac  href="+code=askey_for_eac  id vclasset/sctp/aukeyoc/at/o="sref">keyth_c,sc#L277" id vL27/rekey4 /a>   5"> 275 2hekey4th_cesf">sctp_auth_bytes3/a> *3a h9ee=length9the key vectors, it /sp 93.fol93            struct  aauthref="+code=sctpkeyoc/at/o="sref">keyth_c                    key_idet/sctp/auth.c#key_idhrf=   a href="+code=sckey_idet/sctp/auth.c#key_idhrf=esf">sctp_auth_bytes3/a> *3a h9e7e=chunk9formed by selec, it /sp 93. cl93            struct  a   struccode34ref="+ vLfoundet/sctp/auth.c#foundss="  a105 /a>        if (3a hre3="+9r and con9atenat/ng it to, it /sp 93./sp93ef="net/sctp/auth.c#LLLLLLLLLbreak> 225 /a>        return  a h9o" class=9/ng the numeric, it /sp 9y. /s93a>,ioffstioffstisctp9auth_mak64"> 264 /a>    9     94ef="net/sctp/auth.c#Lruct  a-classet/sctp/auEINVAL /a>           EINVALref=> 225 /a>        return  a h9rd key ba9oc" clas65"> 265 /a>    9     94ef="n>param_hdr /a>. a3href=32re9ctor" cla9} else0 /a>        if ( 9 href94h.c#L265" id aref="net/sct  Followf="nDelete  ce share3 key m2ctp_random_param_t /a> *2a hre2="+9ode=chunk9" class="sref">chunks / 9     94ef="net/sctp/auth.c#L276" id2a 3_del_init href="+code=as2a 3_del_init id v&ref">ep_key /a>-keyoc/at/o="sref">keyth_c                    key_aa 3et/sctp/auth.c#key_aa 3ref=e> 225 /a>        return  a h9r7e=chunk9ss="sref65"> 265 /a>    9     94            sclasset/sctp/aumn vL th_bshkey_f46"oc/at/o="sref">mn vL th_bshkey_f46" id vclasset/sctp/aukeyoc/at/o="sref">keyth_ce> 225 /a>        return  a h9o and con9"+code=len" class="sref"9len3e94dpoint pair shared key3 and 3hen9r" class=9LL" class="sref">NU3    9    394nea hro buil ruct  a0; 225 /a>        return  a h9offset" c9ass="sref">offs5"> 275 /9>isctp_9uth_make_local_vector /a9(i<" 95257" i/pre i/div>


i/div>


T;iLXR   Founityth_c,s c naexperiolloal version by mericallymailto:lxr@calux.noas2xr@calux.noth_c.
i/div>

2xr.calux.no kindly host> 2by mericallyhttp://www.re3pill-calpro.noasRe3pill Lalpro ASth_c,sprovidernof