<div dir="ltr"><div>>> Hi,</div><div>>> I am playing with openssl 1.0.2a - specifically CMS support for ECC.</div><div>>> But what I think should work doesn't.</div><div>>> Commands used and parsed data shown.</div><div>>> (I gave an RSA example as a known good working example)</div><div>>></div><div>>> ./openssl version</div><div>>> OpenSSL 1.0.2a 19 Mar 2015</div><div>>></div><div>>> echo -n 12345678123456781234567812345678 > sess.txt # 32 byte plaintext</div><div>>></div><div>>></div><div>>> #EC fails</div><div>>> ================</div><div>>>   ./openssl ecparam -name prime192v1 -genkey -out ecc.key</div><div>>>   ./openssl req -x509 -new -key ecc.key -out ecc.crt</div><div>>>   ./openssl cms -encrypt -in sess.txt -out encsess.bin -outform PEM ecc.crt</div><div>>>   ./openssl cms -decrypt -in encsess.bin -out decsess.txt -inform PEM</div><div>>> -inkey ecc.key</div><div>>> Error decrypting CMS structure</div><div>>> error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad</div><div>>> decrypt:evp_enc.c:529:</div><div>>></div><div>></div><div>>RSA can decrypt without knowing the certificate but currently EC cannot. So</div><div>>try including the option -recip ecc.crt when you decrypt.</div><div>></div><div>>Steve.</div><div>>--</div><div>>Dr Stephen N. Henson. OpenSSL project core developer.</div><div>>Commercial tech support now available see: <a href="http://www.openssl.org">http://www.openssl.org</a></div><div><br></div><div>Many thanks Steve for the prompt response!</div><div>That fixed it.</div><div>Chris</div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div><br></div></div>