<br /><p>Dear Friends,</p><p>I
have a board which have hardware support for some cryptographic ciphers
(des-ede3-cbc & aes-128-ecb) and also some digest functions (sha1 & md5). Having written an openssl engine for
it, I can use openssl with this HW support, but not when I use it via stunnel.<br /><br />After compiling openssl with my engine support (its name is Sina) and compiling stunnel and configuring it to use that version of openssl and to use that engine, stunnel don't use my ciphers, though, it use my digest functions. I've found it through outputs of my engine's code.</p><p>----------------------------------------------------------- <br />
I have configured the Stunnel in this way:<br />./configure
--host=ppc --with-ssl=/to/my/openssl --prefix=/usr/local/stunnel/dep
--exec-prefix=/usr/local/stunnel/indep --enable-static
--disable-libwrap </p><p>
</p><p>----------------------------------------------------------- <br />
I've added these lines to stunnel.conf:<br />engine = sina #my engine name is sina<br />ciphers = des-ede3-cbc:aes-128-ecb</p><p>----------------------------------------------------------- <br />And some parts of my engine source code:<br />
static const EVP_CIPHER cipher_3des_cbc =<br />
{<br />
NID_des_ede3_cbc,<br />
8, 24, 8,<br />
EVP_CIPH_CBC_MODE,<br />
cipher_init,<br />
cipher_code,<br />
cipher_clean,<br />
sizeof(CIPHER_DATA),<br />
EVP_CIPHER_set_asn1_iv,<br />
EVP_CIPHER_get_asn1_iv,<br />
NULL,<br />
NULL,<br />
};<br />
static const EVP_CIPHER cipher_aes_ecb =<br />
{<br />
NID_aes_128_ecb,<br />
16, 16, 0,<br />
EVP_CIPH_ECB_MODE,<br />
cipher_init,<br />
cipher_code,<br />
cipher_clean,<br />
sizeof(CIPHER_DATA),<br />
EVP_CIPHER_set_asn1_iv,<br />
EVP_CIPHER_get_asn1_iv,<br />
NULL,<br />
NULL<br />
};<br /></p><p>----------------------------------------------------------- <br />
After running stunnel:</p><p># /usr/local/stunnel/dep/sbin/stunnel<br />--> ENGINE_load_builtin_engines 64<br />sina--> ENGINE_load_sina 205<br />sina--> engine_sina 188<br />sina--> bind_sina 150<br />1970.01.01 00:38:22 LOG7[148:1024]: Enabling support for engine 'sina'<br />1970.01.01 00:38:22 LOG7[148:1024]: Initializing engine<br />sina--> sina_init 220<br />sina--> sina_ciphers 255<br />sina--> sina_digests 287<br />1970.01.01 00:38:22 LOG7[148:1024]: Engine initialized<br />1970.01.01 00:38:22 LOG7[148:1024]: Engine closed<br />sina--> sina_digests 287<br />sina--> digest_init 461<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_final 493<br />sina--> do_digest 431<br />sina--> digest_init 461<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_final 493<br />sina--> do_digest 431<br />sina--> sina_digests 287<br />sina--> digest_init 461<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_final 493<br />sina--> do_digest 431<br />sina--> sina_digests 287<br />sina--> digest_init 461<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_final 493<br />sina--> do_digest 431<br />sina--> sina_digests 287<br />sina--> digest_init 461<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_update 475<br />sina--> digest_final 493<br />sina--> do_digest 431<br />1970.01.01 00:38:22 LOG7[148:1024]: RAND_status claims sufficient entropy for the PRNG<br />1970.01.01 00:38:22 LOG6[148:1024]: PRNG seeded successfully<br />1970.01.01 00:38:22 LOG7[148:1024]: Certificate: /usr/local/stunnel/dep/etc/stunnel/stunnel.pem<br />1970.01.01 00:38:22 LOG7[148:1024]: Key file: /usr/local/stunnel/dep/etc/stunnel/stunnel.pem<br />1970.01.01
00:38:22 LOG3[148:1024]: SSL_CTX_set_cipher_list: 1410D0B9:
error:1410D0B9:SSL routines:SSL_CTX_set_cipher_list:no cipher match </p><p>######################################<br />#these "sina->.*" lines are my engine's output.#<br />######################################<br /></p><p>Regards,<br />Hamed Janzadeh</p>
<BR>