<div dir="ltr"><div>Hi Team,</div><div><br></div><div>Can anyone help me with the below queries.</div><div>Thanks in Advance.</div><div><br></div><div>Regards</div><div>Phani</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 28, 2020 at 2:41 PM Phani 2004 <<a href="mailto:phani2004@gmail.com">phani2004@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>OK. I understood that "AES-128-CBC-HMAC-SHA1"(aesni_cbc_hmac_sha1) always does mte.</div><div>I am trying to implement engine implementation of combined mode cipher aes_cbc_hmac_sha1.</div><div>So in my aes_cbc_hmac_sha1_cipher implementation should i do mte only?<br></div><div><br></div><div>If hardware engine can do both operations in a single request and save time. Also, say there is a flag which indicates whether its mte or etm.</div><div>How should my aes_cbc_hmac_sha1 implementation look like?</div><div>Should it do only mte always? Should i have two ciphers, one for etm and other for mte.</div><div>But how to i tell openssl to use this cipher for etm and other for mte without changing the openssl code.</div><div><br></div><div>One more query i have is, how do we pass the etm option to the openssl in conf file.</div><div><br></div><div>Regards</div><div>Phani</div><div><br></div><div>On Fri, Feb 28, 2020 at 8:53 AM Matt Caswell <<a href="mailto:matt@openssl.org" target="_blank">matt@openssl.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 27/02/2020 18:30, Phani 2004 wrote:<br>
> Thanks for the reply.<br>
> <br>
> In ssl_get_evp_cipher api when etm flag is enabled the<br>
> aesni_cbc_hmac_sha1_cipher is not used. In this cipher only it<br>
> implements mte. This part is not clear to me? Support I implement one<br>
> cipher func which needs to handle both etm as well as mte, at the cipher<br>
> api level how do I know if we have etm extension enabled or not.<br>
<br>
At the engine level all it knows about are ciphers and hashes. Engines<br>
know nothing about TLS ciphersuites or TLS extensions. Your engine will<br>
not know whether etm or mte is in use. libssl makes the decision about<br>
what cipher it is going to ask the engine for based on what has been<br>
negotiated.<br>
<br>
If mte is in use then it will first look to see if it has an<br>
implementation of "AES-128-CBC-HMAC-SHA1" (of which<br>
aesni_cbc_hmac_sha1_cipher is the built-in implementation).<br>
<br>
If that is not available it will look for individual implementations of<br>
"AES-128" and "SHA1".<br>
<br>
If etm is in use it will just look for individual implementations of<br>
"AES-128" and "SHA1".<br>
<br>
Matt<br>
<br>
<br>
<br>
> <br>
> Regards<br>
> Phani<br>
> <br>
> On Wed, 26 Feb, 2020, 6:03 PM Hubert Kario, <<a href="mailto:hkario@redhat.com" target="_blank">hkario@redhat.com</a><br>
> <mailto:<a href="mailto:hkario@redhat.com" target="_blank">hkario@redhat.com</a>>> wrote:<br>
> <br>
> On Wednesday, 26 February 2020 08:59:01 CET, Phani 2004 wrote:<br>
> > Thanks for the quick response Matt.<br>
> ><br>
> > My command was :<br>
> > openssl s_client -connect 10.29.20.26 -cipher ECDHE-RSA-AES128-SHA<br>
> -tls1_2.<br>
> > I did not realise that "2" was not copied.<br>
> ><br>
> > I am trying to implement combined algo support on our engine.<br>
> > I am using the openssl s_server and s_client apps to validate my<br>
> > implementation.<br>
> > The combined algo that i am looking to implement is AES128/256 and<br>
> SHA1.<br>
> > Its clear that i should always use tls version less than 1.3<br>
> otherwise GCM<br>
> > ciphers are used.<br>
> ><br>
> > What cipher suites can i use to validate the above combination of<br>
> combined<br>
> > algo?<br>
> <br>
> OpenSSL internally treats key exchange and symmetric cipher<br>
> separately, so<br>
> all "*AES128-SHA" ciphers use the same cipher backend<br>
> <br>
> you should also test AES256-SHA, AES128-SHA256, AES256-SHA256 and<br>
> AES256-SHA384<br>
> <br>
> > Which tls versions support which cipher suites?<br>
> <br>
> *-SHA1 and *MD5 is supported by everything between SSL3 and TLS 1.2<br>
> *-SHA256 and *-SHA384 (if they are not TLS1.3 cipher suites) are<br>
> supported<br>
> by TLS 1.2 only<br>
> <br>
> > Should i be doing "encrypt-then-mac" or "mac-then-encrypt" in my<br>
> > implementation?<br>
> > Does the cipher suite decide this?<br>
> > If yes, what are the ciphers which do "encrypt-then-mac" and what<br>
> ciphers<br>
> > to "mac-then-encrypt"?<br>
> <br>
> etm vs mte happens based on negotiated extension, not cipher suite<br>
> <br>
> -- <br>
> Regards,<br>
> Hubert Kario<br>
> Senior Quality Engineer, QE BaseOS Security team<br>
> Web: <a href="http://www.cz.redhat.com" rel="noreferrer" target="_blank">www.cz.redhat.com</a> <<a href="http://www.cz.redhat.com" rel="noreferrer" target="_blank">http://www.cz.redhat.com</a>><br>
> Red Hat Czech s.r.o., Purkyňova 115, 612 00 Brno, Czech Republic<br>
> <br>
</blockquote></div></div>
</blockquote></div></div>