linux/crypto/algboss.c
<<
v4.4.1/spae=" 4.1/form=" 4.1a v4.4. href="../linux+v3pti.2/crypto/algboss.c"> v4.4.1img src="../.static/gfx/right.png" alt=">>"> v1/spae=" v1spae class="lxr_search"> v4. v4.4.1input typ4. hidden" nam4. navtarget" v4. "> v4.4.1input typ4. text" nam4. search" id. search"> v4.4.1butt >typ4. submit">Search v4.4.Prefs" 4.1/a> v1/spae="4.4. .1/div="4.4. .1form acalue="ajax+*" method="post" onsubmit="return false;"> v1input typ4. hidden" nam4. ajax_lookup" id. ajax_lookup" v4. "> 4.4. .1/form=" 4.4. .1div class="headingbott m">" 1div id. file_contents"=
. .11/a>1spae class="comment">/*1/spae=". .21/a>1spae class="comment"> * Create default crypto algorithm instances.1/spae=". .31/a>1spae class="comment"> *1/spae=". .41/a>1spae class="comment"> * Copyright (c) 2006 Herbert Xu <herbert@gondor.apaea.org.au>1/spae=". .51/a>1spae class="comment"> *1/spae=". .61/a>1spae class="comment"> * This program is free software; you cae redistribute it and/or modify it1/spae=". .71/a>1spae class="comment"> * under the terms of the GNU General Public License as published by the Free1/spae=". .81/a>1spae class="comment"> * Software Foundaalue; either vers	  >2 of the License, or (at your  value)1/spae=". .91/a>1spae class="comment"> * any later vers	  .1/spae=". tiona>1spae class="comment"> *1/spae=". 111/a>1spae class="comment"> */1/spae=". 121/a>". 131/a>#include <crypto/internal/aead.h1/a>>". 141/a>#include <linux/complealue.h1/a>>". 151/a>#include <linux/ctyp4.h1/a>>". 161/a>#include <linux/err.h1/a>>". 171/a>#include <linux/init.h1/a>>". 181/a>#include <linux/kthread.h1/a>>". 191/a>#include <linux/modul4.h1/a>>". 201/a>#include <linux/notifier.h1/a>>". 211/a>#include <linux/rtnetlink.h1/a>>". 221/a>#include <linux/sched.h1/a>>". 231/a>#include <linux/slab.h1/a>>". 241/a>#include <linux/string.h1/a>>". 251/a>". 261/a>#include "internal.h1/a>"". 271/a>". 281/a>struct.1a href="+code=cryptomgr_param" class="sref">cryptomgr_param1/a> {". 291/a>        struct.1a href="+code=rtattr" class="sref">rtattr1/a> *1a href="+code=tb" class="sref">tb1/a>[1a href="+code=CRYPTO_MAX_ATTRS" class="sref">CRYPTO_MAX_ATTRS1/a> + 2];". 301/a>". 311/a>        struct.{". 321/a>                struct.1a href="+code=rtattr" class="sref">rtattr1/a> 1a href="+code=attr" class="sref">attr1/a>;". 331/a>                struct.1a href="+code=crypto_attr_typ4" class="sref">crypto_attr_typ41/a> 1a href="+code=daaa" class="sref">daaa1/a>;". 341/a>        } 1a href="+code=typ4" class="sref">typ41/a>;". 351/a>". 361/a>        un	  >{". 371/a>                struct.1a href="+code=rtattr" class="sref">rtattr1/a> 1a href="+code=attr" class="sref">attr1/a>;". 381/a>                struct.{". 391/a>                        struct.1a href="+code=rtattr" class="sref">rtattr1/a> 1a href="+code=attr" class="sref">attr1/a>;". 401/a>                        struct.1a href="+code=crypto_attr_alg" class="sref">crypto_attr_alg1/a> 1a href="+code=daaa" class="sref">daaa1/a>;". 411/a>                } 1a href="+code=alg" class="sref">alg1/a>;". 421/a>                struct.{". 431/a>                        struct.1a href="+code=rtattr" class="sref">rtattr1/a> 1a href="+code=attr" class="sref">attr1/a>;". 441/a>                        struct.1a href="+code=crypto_attr_u32" class="sref">crypto_attr_u321/a> 1a href="+code=daaa" class="sref">daaa1/a>;". 451/a>                } 1a href="+code=nu32" class="sref">nu321/a>;". 461/a>        } 1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=CRYPTO_MAX_ATTRS" class="sref">CRYPTO_MAX_ATTRS1/a>];". 471/a>". 481/a>        char 1a href="+code=template" class="sref">template1/a>[1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>];". 491/a>". 501/a>        struct.1a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=larval" class="sref">larval1/a>;". 511/a>". 521/a>        1a href="+code=u32" class="sref">u321/a> 1a href="+code=otyp4" class="sref">otyp41/a>;". 531/a>        1a href="+code=u32" class="sref">u321/a> 1a href="+code=omask" class="sref">omask1/a>;". 541/a>};". 551/a>". 561/a>struct.1a href="+code=crypto_test_param" class="sref">crypto_test_param1/a> {". 571/a>        char 1a href="+code=driver" class="sref">driver1/a>[1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>];". 581/a>        char 1a href="+code=alg" class="sref">alg1/a>[1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>];". 591/a>        1a href="+code=u32" class="sref">u321/a> 1a href="+code=typ4" class="sref">typ41/a>;". 601/a>};". 611/a>". 621/a>static int.1a href="+code=cryptomgr_prob4" class="sref">cryptomgr_prob41/a>(void *1a href="+code=daaa" class="sref">daaa1/a>)". 631/a>{". 641/a>        struct.1a href="+code=cryptomgr_param" class="sref">cryptomgr_param1/a> *1a href="+code=param" class="sref">param1/a> = 1a href="+code=daaa" class="sref">daaa1/a>;". 651/a>        struct.1a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=tmpl" class="sref">tmpl1/a>;". 661/a>        struct.1a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=inst" class="sref">inst1/a>;". 671/a>        int.1a href="+code=err" class="sref">err1/a>;". 681/a>". 691/a>        1a href="+code=tmpl" class="sref">tmpl1/a> = 1a href="+code=crypto_lookup_template" class="sref">crypto_lookup_template1/a>(1a href="+code=param" class="sref">param1/a>->1a href="+code=template" class="sref">template1/a>);". 701/a>        if (!1a href="+code=tmpl" class="sref">tmpl1/a>)". 711/a>                goto 1a href="+code=out" class="sref">out1/a>;". 721/a>". 731/a>        do {". 741/a>                if (1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=create" class="sref">create1/a>) {". 751/a>                        1a href="+code=err" class="sref">err1/a> = 1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=create" class="sref">create1/a>(1a href="+code=tmpl" class="sref">tmpl1/a>, 1a href="+code=param" class="sref">param1/a>->1a href="+code=tb" class="sref">tb1/a>);". 761/a>                        continue;". 771/a>                }". 781/a>". 791/a>                1a href="+code=inst" class="sref">inst1/a> = 1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=alloc" class="sref">alloc1/a>(1a href="+code=param" class="sref">param1/a>->1a href="+code=tb" class="sref">tb1/a>);". 801/a>                if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=inst" class="sref">inst1/a>))". 811/a>                        1a href="+code=err" class="sref">err1/a> = 1a href="+code=PTR_ERR" class="sref">PTR_ERR1/a>(1a href="+code=inst" class="sref">inst1/a>);". 821/a>                else if ((1a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_register_instance" class="sref">crypto_register_instance1/a>(1a href="+code=tmpl" class="sref">tmpl1/a>, 1a href="+code=inst" class="sref">inst1/a>)))". 831/a>                        1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=free" class="sref">free1/a>(1a href="+code=inst" class="sref">inst1/a>);". 841/a>        } while (1a href="+code=err" class="sref">err1/a> == -1a href="+code=EAGAIN" class="sref">EAGAIN1/a> && !1a href="+code=signal_pending" class="sref">signal_pending1/a>(1a href="+code=current" class="sref">current1/a>));". 851/a>". 861/a>        1a href="+code=crypto_tmpl_put" class="sref">crypto_tmpl_put1/a>(1a href="+code=tmpl" class="sref">tmpl1/a>);". 871/a>". 881/a>1a href="+code=out" class="sref">out1/a>:". 891/a>        1a href="+code=compleae_all" class="sref">compleae_all1/a>(&1a href="+code=param" class="sref">param1/a>->1a href="+code=larval" class="sref">larval1/a>->1a href="+code=complealue" class="sref">complealue1/a>);". 901/a>        1a href="+code=crypto_alg_put" class="sref">crypto_alg_put1/a>(&1a href="+code=param" class="sref">param1/a>->1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>);". 911/a>        1a href="+code=kfree" class="sref">kfree1/a>(1a href="+code=param" class="sref">param1/a>);". 921/a>        1a href="+code=modul4_put_and_exit" class="sref">modul4_put_and_exit1/a>(0);". 931/a>}". 941/a>". 951/a>static int.1a href="+code=cryptomgr_schedul4_prob4" class="sref">cryptomgr_schedul4_prob41/a>(struct.1a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=larval" class="sref">larval1/a>)". 961/a>{". 971/a>        struct.1a href="+code=task_struct" class="sref">task_struct1/a> *1a href="+code=thread" class="sref">thread1/a>;". 981/a>        struct.1a href="+code=cryptomgr_param" class="sref">cryptomgr_param1/a> *1a href="+code=param" class="sref">param1/a>;". 991/a>        const char *1a href="+code=nam4" class="sref">nam41/a> = 1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_nam4" class="sref">cra_nam41/a>;".1001/a>        const char *1a href="+code=p" class="sref">p1/a>;".1011/a>        unsigned int.1a href="+code=lee" class="sref">lee1/a>;".1021/a>        int.1a href="+code=i" class="sref">i1/a>;".1031/a>".1041/a>        if (!1a href="+code=try_modul4_get" class="sref">try_modul4_get1/a>(1a href="+code=THIS_MODULE" class="sref">THIS_MODULE1/a>))".1051/a>                goto 1a href="+code=err" class="sref">err1/a>;".1061/a>".1071/a>        1a href="+code=param" class="sref">param1/a> = 1a href="+code=kzalloc" class="sref">kzalloc1/a>(sizeof(*1a href="+code=param" class="sref">param1/a>), 1a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL1/a>);".1081/a>        if (!1a href="+code=param" class="sref">param1/a>)".1091/a>                goto 1a href="+code=err_put_modul4" class="sref">err_put_modul41/a>;".1101/a>".1111/a>        for (1a href="+code=p" class="sref">p1/a> = 1a href="+code=nam4" class="sref">nam41/a>;.1a href="+code=isalnum" class="sref">isalnum1/a>(*1a href="+code=p" class="sref">p1/a>) || *1a href="+code=p" class="sref">p1/a> == 1spae class="string">'-'1/spae= || *1a href="+code=p" class="sref">p1/a> == 1spae class="string">'_'1/spae=;.1a href="+code=p" class="sref">p1/a>++)".1121/a>                ;".1131/a>".1141/a>        1a href="+code=lee" class="sref">lee1/a> = 1a href="+code=p" class="sref">p1/a> - 1a href="+code=nam4" class="sref">nam41/a>;".1151/a>        if (!1a href="+code=lee" class="sref">lee1/a> || *1a href="+code=p" class="sref">p1/a> != 1spae class="string">'('1/spae=)".1161/a>                goto 1a href="+code=err_free_param" class="sref">err_free_param1/a>;".1171/a>".1181/a>        1a href="+code=memcpy" class="sref">memcpy1/a>(1a href="+code=param" class="sref">param1/a>->1a href="+code=template" class="sref">template1/a>, 1a href="+code=nam4" class="sref">nam41/a>, 1a href="+code=lee" class="sref">lee1/a>);".1191/a>".1201/a>        1a href="+code=i" class="sref">i1/a> = 0;".1211/a>        for (;;) {".1221/a>                int.1a href="+code=notnum" class="sref">notnum1/a> = 0;".1231/a>".1241/a>                1a href="+code=nam4" class="sref">nam41/a> = ++1a href="+code=p" class="sref">p1/a>;".1251/a>                1a href="+code=lee" class="sref">lee1/a> = 0;".1261/a>".1271/a>                for (;.1a href="+code=isalnum" class="sref">isalnum1/a>(*1a href="+code=p" class="sref">p1/a>) || *1a href="+code=p" class="sref">p1/a> == 1spae class="string">'-'1/spae= || *1a href="+code=p" class="sref">p1/a> == 1spae class="string">'_'1/spae=;.1a href="+code=p" class="sref">p1/a>++)".1281/a>                        1a href="+code=notnum" class="sref">notnum1/a> |= !1a href="+code=isdigit" class="sref">isdigit1/a>(*1a href="+code=p" class="sref">p1/a>);".1291/a>".1301/a>                if (*1a href="+code=p" class="sref">p1/a> == 1spae class="string">'('1/spae=) {".1311/a>                        int.1a href="+code=recurs	  " class="sref">recurs	  1/a> = 0;".1321/a>".1331/a>                        for (;;) {".1341/a>                                if (!*++1a href="+code=p" class="sref">p1/a>)".1351/a>                                        goto 1a href="+code=err_free_param" class="sref">err_free_param1/a>;".1361/a>                                if (*1a href="+code=p" class="sref">p1/a> == 1spae class="string">'('1/spae=)".1371/a>                                        1a href="+code=recurs	  " class="sref">recurs	  1/a>++;".1381/a>                                else if (*1a href="+code=p" class="sref">p1/a> == 1spae class="string">')'1/spae= && !1a href="+code=recurs	  " class="sref">recurs	  1/a>--)".1391/a>                                        break;".1401/a>                        }".1411/a>".1421/a>                        1a href="+code=notnum" class="sref">notnum1/a> = 1;".1431/a>                        1a href="+code=p" class="sref">p1/a>++;".1441/a>                }".1451/a>".1461/a>                1a href="+code=lee" class="sref">lee1/a> = 1a href="+code=p" class="sref">p1/a> - 1a href="+code=nam4" class="sref">nam41/a>;".1471/a>                if (!1a href="+code=lee" class="sref">lee1/a>)".1481/a>                        goto 1a href="+code=err_free_param" class="sref">err_free_param1/a>;".1491/a>".1501/a>                if (1a href="+code=notnum" class="sref">notnum1/a>) {".1511/a>                        1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=alg" class="sref">alg1/a>.1a href="+code=attr" class="sref">attr1/a>.1a href="+code=rta_lee" class="sref">rta_lee1/a> =".1521/a>                                sizeof(1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=alg" class="sref">alg1/a>);".1531/a>                        1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=alg" class="sref">alg1/a>.1a href="+code=attr" class="sref">attr1/a>.1a href="+code=rta_typ4" class="sref">rta_typ41/a> = 1a href="+code=CRYPTOA_ALG" class="sref">CRYPTOA_ALG1/a>;".1541/a>                        1a href="+code=memcpy" class="sref">memcpy1/a>(1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=alg" class="sref">alg1/a>.1a href="+code=daaa" class="sref">daaa1/a>.1a href="+code=nam4" class="sref">nam41/a>, 1a href="+code=nam4" class="sref">nam41/a>, 1a href="+code=lee" class="sref">lee1/a>);".1551/a>                } else {".1561/a>                        1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=nu32" class="sref">nu321/a>.1a href="+code=attr" class="sref">attr1/a>.1a href="+code=rta_lee" class="sref">rta_lee1/a> =".1571/a>                                sizeof(1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=nu32" class="sref">nu321/a>);".1581/a>                        1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=nu32" class="sref">nu321/a>.1a href="+code=attr" class="sref">attr1/a>.1a href="+code=rta_typ4" class="sref">rta_typ41/a> = 1a href="+code=CRYPTOA_U32" class="sref">CRYPTOA_U321/a>;".1591/a>                        1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=nu32" class="sref">nu321/a>.1a href="+code=daaa" class="sref">daaa1/a>.1a href="+code=num" class="sref">num1/a> =".1601/a>                                1a href="+code=simple_strtol" class="sref">simple_strtol1/a>(1a href="+code=nam4" class="sref">nam41/a>, 1a href="+code=NULL" class="sref">NULL1/a>, 0);".1611/a>                }".1621/a>".1631/a>                1a href="+code=param" class="sref">param1/a>->1a href="+code=tb" class="sref">tb1/a>[1a href="+code=i" class="sref">i1/a> + 1] = &1a href="+code=param" class="sref">param1/a>->1a href="+code=attrs" class="sref">attrs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=attr" class="sref">attr1/a>;".1641/a>                1a href="+code=i" class="sref">i1/a>++;".1651/a>".1661/a>                if (1a href="+code=i" class="sref">i1/a> >= 1a href="+code=CRYPTO_MAX_ATTRS" class="sref">CRYPTO_MAX_ATTRS1/a>)".1671/a>                        goto 1a href="+code=err_free_param" class="sref">err_free_param1/a>;".1681/a>".1691/a>                if (*1a href="+code=p" class="sref">p1/a> == 1spae class="string">')'1/spae=)".1701/a>                        break;".1711/a>".1721/a>                if (*1a href="+code=p" class="sref">p1/a> != 1spae class="string">','1/spae=)".1731/a>                        goto 1a href="+code=err_free_param" class="sref">err_free_param1/a>;".1741/a>        }".1751/a>".1761/a>        if (!1a href="+code=i" class="sref">i1/a>)".1771/a>                goto 1a href="+code=err_free_param" class="sref">err_free_param1/a>;".1781/a>".1791/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=tb" class="sref">tb1/a>[1a href="+code=i" class="sref">i1/a> + 1] = 1a href="+code=NULL" class="sref">NULL1/a>;".1801/a>".1811/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=typ4" class="sref">typ41/a>.1a href="+code=attr" class="sref">attr1/a>.1a href="+code=rta_lee" class="sref">rta_lee1/a> = sizeof(1a href="+code=param" class="sref">param1/a>->1a href="+code=typ4" class="sref">typ41/a>);".1821/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=typ4" class="sref">typ41/a>.1a href="+code=attr" class="sref">attr1/a>.1a href="+code=rta_typ4" class="sref">rta_typ41/a> = 1a href="+code=CRYPTOA_TYPE" class="sref">CRYPTOA_TYPE1/a>;".1831/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=typ4" class="sref">typ41/a>.1a href="+code=daaa" class="sref">daaa1/a>.1a href="+code=typ4" class="sref">typ41/a> = 1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_flags" class="sref">cra_flags1/a> & ~1a href="+code=CRYPTO_ALG_TESTED" class="sref">CRYPTO_ALG_TESTED1/a>;".1841/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=typ4" class="sref">typ41/a>.1a href="+code=daaa" class="sref">daaa1/a>.1a href="+code=mask" class="sref">mask1/a> = 1a href="+code=larval" class="sref">larval1/a>->1a href="+code=mask" class="sref">mask1/a> & ~1a href="+code=CRYPTO_ALG_TESTED" class="sref">CRYPTO_ALG_TESTED1/a>;".1851/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=tb" class="sref">tb1/a>[0] = &1a href="+code=param" class="sref">param1/a>->1a href="+code=typ4" class="sref">typ41/a>.1a href="+code=attr" class="sref">attr1/a>;".1861/a>".1871/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=otyp4" class="sref">otyp41/a> = 1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_flags" class="sref">cra_flags1/a>;".1881/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=omask" class="sref">omask1/a> = 1a href="+code=larval" class="sref">larval1/a>->1a href="+code=mask" class="sref">mask1/a>;".1891/a>".1901/a>        1a href="+code=crypto_alg_get" class="sref">crypto_alg_get1/a>(&1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>);".1911/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=larval" class="sref">larval1/a> = 1a href="+code=larval" class="sref">larval1/a>;".1921/a>".1931/a>        1a href="+code=thread" class="sref">thread1/a> = 1a href="+code=kthread_rue" class="sref">kthread_rue1/a>(1a href="+code=cryptomgr_prob4" class="sref">cryptomgr_prob41/a>, 1a href="+code=param" class="sref">param1/a>, 1spae class="string">"cryptomgr_prob4".1941/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=thread" class="sref">thread1/a>))".1951/a>                goto 1a href="+code=err_put_larval" class="sref">err_put_larval1/a>;".1961/a>".1971/a>        1a href="+code=wait_for_complealue_interruptibl4" class="sref">wait_for_complealue_interruptibl41/a>(&1a href="+code=larval" class="sref">larval1/a>->1a href="+code=complealue" class="sref">complealue1/a>);".1981/a>".1991/a>        return 1a href="+code=NOTIFY_STOP" class="sref">NOTIFY_STOP1/a>;".2001/a>".2011/a>1a href="+code=err_put_larval" class="sref">err_put_larval1/a>:".2021/a>        1a href="+code=crypto_alg_put" class="sref">crypto_alg_put1/a>(&1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>);".2031/a>1a href="+code=err_free_param" class="sref">err_free_param1/a>:".2041/a>        1a href="+code=kfree" class="sref">kfree1/a>(1a href="+code=param" class="sref">param1/a>);".2051/a>1a href="+code=err_put_modul4" class="sref">err_put_modul41/a>:".2061/a>        1a href="+code=modul4_put" class="sref">modul4_put1/a>(1a href="+code=THIS_MODULE" class="sref">THIS_MODULE1/a>);".2071/a>1a href="+code=err" class="sref">err1/a>:".2081/a>        return 1a href="+code=NOTIFY_OK" class="sref">NOTIFY_OK1/a>;".2091/a>}".2101/a>".2111/a>static int.1a href="+code=cryptomgr_test" class="sref">cryptomgr_test1/a>(void *1a href="+code=daaa" class="sref">daaa1/a>)".2121/a>{".2131/a>        struct.1a href="+code=crypto_test_param" class="sref">crypto_test_param1/a> *1a href="+code=param" class="sref">param1/a> = 1a href="+code=daaa" class="sref">daaa1/a>;".2141/a>        1a href="+code=u32" class="sref">u321/a> 1a href="+code=typ4" class="sref">typ41/a> = 1a href="+code=param" class="sref">param1/a>->1a href="+code=typ4" class="sref">typ41/a>;".2151/a>        int.1a href="+code=err" class="sref">err1/a> = 0;".2161/a>".2171/a>#ifdef 1a href="+code=CONFIG_CRYPTO_MANAGER_DISABLE_TESTS" class="sref">CONFIG_CRYPTO_MANAGER_DISABLE_TESTS1/a>".2181/a>        goto 1a href="+code=skiptest" class="sref">skiptest1/a>;".2191/a>#endif".2201/a>".2211/a>        if (1a href="+code=typ4" class="sref">typ41/a> & 1a href="+code=CRYPTO_ALG_TESTED" class="sref">CRYPTO_ALG_TESTED1/a>)".2221/a>                goto 1a href="+code=skiptest" class="sref">skiptest1/a>;".2231/a>".2241/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=alg_test" class="sref">alg_test1/a>(1a href="+code=param" class="sref">param1/a>->1a href="+code=driver" class="sref">driver1/a>, 1a href="+code=param" class="sref">param1/a>->1a href="+code=alg" class="sref">alg1/a>, 1a href="+code=typ4" class="sref">typ41/a>, 1a href="+code=CRYPTO_ALG_TESTED" class="sref">CRYPTO_ALG_TESTED1/a>);".2251/a>".2261/a>1a href="+code=skiptest" class="sref">skiptest1/a>:".2271/a>        1a href="+code=crypto_alg_tested" class="sref">crypto_alg_tested1/a>(1a href="+code=param" class="sref">param1/a>->1a href="+code=driver" class="sref">driver1/a>, 1a href="+code=err" class="sref">err1/a>);".2281/a>".2291/a>        1a href="+code=kfree" class="sref">kfree1/a>(1a href="+code=param" class="sref">param1/a>);".2301/a>        1a href="+code=modul4_put_and_exit" class="sref">modul4_put_and_exit1/a>(0);".2311/a>}".2321/a>".2331/a>static int.1a href="+code=cryptomgr_schedul4_test" class="sref">cryptomgr_schedul4_test1/a>(struct.1a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)".2341/a>{".2351/a>        struct.1a href="+code=task_struct" class="sref">task_struct1/a> *1a href="+code=thread" class="sref">thread1/a>;".2361/a>        struct.1a href="+code=crypto_test_param" class="sref">crypto_test_param1/a> *1a href="+code=param" class="sref">param1/a>;".2371/a>        1a href="+code=u32" class="sref">u321/a> 1a href="+code=typ4" class="sref">typ41/a>;".2381/a>".2391/a>        if (!1a href="+code=try_modul4_get" class="sref">try_modul4_get1/a>(1a href="+code=THIS_MODULE" class="sref">THIS_MODULE1/a>))".2401/a>                goto 1a href="+code=err" class="sref">err1/a>;".2411/a>".2421/a>        1a href="+code=param" class="sref">param1/a> = 1a href="+code=kzalloc" class="sref">kzalloc1/a>(sizeof(*1a href="+code=param" class="sref">param1/a>), 1a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL1/a>);".2431/a>        if (!1a href="+code=param" class="sref">param1/a>)".2441/a>                goto 1a href="+code=err_put_modul4" class="sref">err_put_modul41/a>;".2451/a>".2461/a>        1a href="+code=memcpy" class="sref">memcpy1/a>(1a href="+code=param" class="sref">param1/a>->1a href="+code=driver" class="sref">driver1/a>, 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_driver_nam4" class="sref">cra_driver_nam41/a>, sizeof(1a href="+code=param" class="sref">param1/a>->1a href="+code=driver" class="sref">driver1/a>));".2471/a>        1a href="+code=memcpy" class="sref">memcpy1/a>(1a href="+code=param" class="sref">param1/a>->1a href="+code=alg" class="sref">alg1/a>, 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_nam4" class="sref">cra_nam41/a>, sizeof(1a href="+code=param" class="sref">param1/a>->1a href="+code=alg" class="sref">alg1/a>));".2481/a>        1a href="+code=typ4" class="sref">typ41/a> = 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a>;".2491/a>".2501/a>        1spae class="comment">/* This piece of crap needs to disappear into per-typ4 test hooks. */.2511/a>        if ((!((1a href="+code=typ4" class="sref">typ41/a> ^ 1a href="+code=CRYPTO_ALG_TYPE_BLKCIPHER" class="sref">CRYPTO_ALG_TYPE_BLKCIPHER1/a>) &".2521/a>               1a href="+code=CRYPTO_ALG_TYPE_BLKCIPHER_MASK" class="sref">CRYPTO_ALG_TYPE_BLKCIPHER_MASK1/a>) && !(1a href="+code=typ4" class="sref">typ41/a> & 1a href="+code=CRYPTO_ALG_GENIV" class="sref">CRYPTO_ALG_GENIV1/a>) &&".2531/a>             ((1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> & 1a href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK1/a>) ==".2541/a>              1a href="+code=CRYPTO_ALG_TYPE_BLKCIPHER" class="sref">CRYPTO_ALG_TYPE_BLKCIPHER1/a> ? 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_blkcipher" class="sref">cra_blkcipher1/a>.1a href="+code=ivsize" class="sref">ivsize1/a> :".2551/a>                                          1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_ablkcipher" class="sref">cra_ablkcipher1/a>.1a href="+code=ivsize" class="sref">ivsize1/a>)) ||".2561/a>            (!((1a href="+code=typ4" class="sref">typ41/a> ^ 1a href="+code=CRYPTO_ALG_TYPE_AEAD" class="sref">CRYPTO_ALG_TYPE_AEAD1/a>) & 1a href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK1/a>) &&".2571/a>             1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_typ4" class="sref">cra_typ41/a> == &1a href="+code=crypto_nivaead_typ4" class="sref">crypto_nivaead_typ41/a> && 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_aead" class="sref">cra_aead1/a>.1a href="+code=ivsize" class="sref">ivsize1/a>))".2581/a>                1a href="+code=typ4" class="sref">typ41/a> |= 1a href="+code=CRYPTO_ALG_TESTED" class="sref">CRYPTO_ALG_TESTED1/a>;".2591/a>".2601/a>        1a href="+code=param" class="sref">param1/a>->1a href="+code=typ4" class="sref">typ41/a> = 1a href="+code=typ4" class="sref">typ41/a>;".2611/a>".2621/a>        1a href="+code=thread" class="sref">thread1/a> = 1a href="+code=kthread_rue" class="sref">kthread_rue1/a>(1a href="+code=cryptomgr_test" class="sref">cryptomgr_test1/a>, 1a href="+code=param" class="sref">param1/a>, 1spae class="string">"cryptomgr_test".2631/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=thread" class="sref">thread1/a>))".2641/a>                goto 1a href="+code=err_free_param" class="sref">err_free_param1/a>;".2651/a>".2661/a>        return 1a href="+code=NOTIFY_STOP" class="sref">NOTIFY_STOP1/a>;".2671/a>".2681/a>1a href="+code=err_free_param" class="sref">err_free_param1/a>:".2691/a>        1a href="+code=kfree" class="sref">kfree1/a>(1a href="+code=param" class="sref">param1/a>);".2701/a>1a href="+code=err_put_modul4" class="sref">err_put_modul41/a>:".2711/a>        1a href="+code=modul4_put" class="sref">modul4_put1/a>(1a href="+code=THIS_MODULE" class="sref">THIS_MODULE1/a>);".2721/a>1a href="+code=err" class="sref">err1/a>:".2731/a>        return 1a href="+code=NOTIFY_OK" class="sref">NOTIFY_OK1/a>;".2741/a>}".2751/a>".2761/a>static int.1a href="+code=cryptomgr_notify" class="sref">cryptomgr_notify1/a>(struct.1a href="+code=notifier_block" class="sref">notifier_block1/a> *1a href="+code=this" class="sref">this1/a>, unsigned long 1a href="+code=msg" class="sref">msg1/a>,".2771/a>                            void *1a href="+code=daaa" class="sref">daaa1/a>)".2781/a>{".2791/a>        switch (1a href="+code=msg" class="sref">msg1/a>) {".2801/a>        case 1a href="+code=CRYPTO_MSG_ALG_REQUEST" class="sref">CRYPTO_MSG_ALG_REQUEST1/a>:".2811/a>                return 1a href="+code=cryptomgr_schedul4_prob4" class="sref">cryptomgr_schedul4_prob41/a>(1a href="+code=daaa" class="sref">daaa1/a>);".2821/a>        case 1a href="+code=CRYPTO_MSG_ALG_REGISTER" class="sref">CRYPTO_MSG_ALG_REGISTER1/a>:".2831/a>                return 1a href="+code=cryptomgr_schedul4_test" class="sref">cryptomgr_schedul4_test1/a>(1a href="+code=daaa" class="sref">daaa1/a>);".2841/a>        }".2851/a>".2861/a>        return 1a href="+code=NOTIFY_DONE" class="sref">NOTIFY_DONE1/a>;".2871/a>}".2881/a>".2891/a>static struct.1a href="+code=notifier_block" class="sref">notifier_block1/a> 1a href="+code=cryptomgr_notifier" class="sref">cryptomgr_notifier1/a> = {".2901/a>        .1a href="+code=notifier_call" class="sref">notifier_call1/a> = 1a href="+code=cryptomgr_notify" class="sref">cryptomgr_notify1/a>,".2911/a>};".2921/a>".2931/a>static int.1a href="+code=__init" class="sref">__init1/a> 1a href="+code=cryptomgr_init" class="sref">cryptomgr_init1/a>(void)".2941/a>{".2951/a>        return 1a href="+code=crypto_register_notifier" class="sref">crypto_register_notifier1/a>(&1a href="+code=cryptomgr_notifier" class="sref">cryptomgr_notifier1/a>);".2961/a>}".2971/a>".2981/a>static void 1a href="+code=__exit" class="sref">__exit1/a> 1a href="+code=cryptomgr_exit" class="sref">cryptomgr_exit1/a>(void)".2991/a>{".3001/a>        int.1a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_unregister_notifier" class="sref">crypto_unregister_notifier1/a>(&1a href="+code=cryptomgr_notifier" class="sref">cryptomgr_notifier1/a>);".3011/a>        1a href="+code=BUG_ON" class="sref">BUG_ON1/a>(1a href="+code=err" class="sref">err1/a>);".3021/a>}".3031/a>".3041/a>1a href="+code=subsys_initcall" class="sref">subsys_initcall1/a>(1a href="+code=cryptomgr_init" class="sref">cryptomgr_init1/a>);".3051/a>1a href="+code=modul4_exit" class="sref">modul4_exit1/a>(1a href="+code=cryptomgr_exit" class="sref">cryptomgr_exit1/a>);".3061/a>".3071/a>1a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE1/a>(1spae class="string">"GPL".3081/a>1a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION1/a>(1spae class="string">"Crypto Algorithm Manager".3091/a>
lxr.linux.no kindly hosted by 1a href="http://www.redpill-linpro.no">Redpill Linpro AS1/a>, provider of Linux consulting and operaalues services since.1995.