<div dir="ltr">openssl version: <b>1.0.1e</b><div><br></div><div>During reboot, the following code is used to set up the tpm engine:</div><div><br></div><div>   ENGINE_load_builtin_engines();<br>    e = ENGINE_by_id("tpm");<br>    if(!e) {<br>        /* the engine isn't available */<br>        ERR("ENGINE_by_id failed.");<br>        ERR_print_errors_fp(stderr);<br>        return CU_ERROR;<br>    }<br><br>    if (!ENGINE_init(e)) {<br>        int err_num = ERR_get_error();<br>        char buf[128] = {0};<br><b>        ERR("ENGINE_init failed.");<br></b>        printf("ENGINE_init error: %s\n", ERR_error_string(err_num, buf));<br>        return CU_ERROR;<br>    }<br></div><div><br></div><div>What happens is that ENGINE_init(e) fails sometimes (not always) with the following error:</div><div><br></div><div><b>ENGINE_init error: error:00000000:lib(0):func(0):reason(0)</b></div><div><br></div><div>There is no race condition in this case as far as I can tell.</div><div><br></div><div>Is this a bug in this version of openSSL?</div><div><br></div><div>Thanks,</div><div>Joe</div></div>