<div dir="ltr">Hi Matt,<div><br></div><div>Thank you for the response.</div><div>But I wanted to know the handshake behavior when client has support for "TLSv1.3,TLSv1.2" and server has support for ("TLSv1.2,TLSv1")  or ("TLSv1.2,SSLv3).</div><div><br></div><div>Both client and server is built with openssl 1.1.1 and the above connection fails with handshake failure.  The same connection works if server has continious range of protocol version such as ("TLSv1.2,TLSv1.1,TLSv1,SSLv3). </div><div><br></div><div>So, is the handshake behavior change if the supported protocol versions are not in continuous range ? </div><div><br></div><div>Thanks and regards,</div><div>Ram Krushna</div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 24, 2018 at 10:14 PM <<a href="mailto:openssl-users-request@openssl.org">openssl-users-request@openssl.org</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">Send openssl-users mailing list submissions to<br>
        <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:openssl-users-request@openssl.org" target="_blank">openssl-users-request@openssl.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:openssl-users-owner@openssl.org" target="_blank">openssl-users-owner@openssl.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of openssl-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: Reg issue in alert message (Matt Caswell)<br>
   2. Using SM2 ECIES in 1.1.1 (Akira Takahashi)<br>
   3. Re: Using SM2 ECIES in 1.1.1 (Matt Caswell)<br>
   4. openssl cms encrypt recipientInfo [questions for  openssl<br>
      developers]. (???? ?????????)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 24 Oct 2018 13:57:04 +0100<br>
From: Matt Caswell <<a href="mailto:matt@openssl.org" target="_blank">matt@openssl.org</a>><br>
To: <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a><br>
Subject: Re: [openssl-users] Reg issue in alert message<br>
Message-ID: <<a href="mailto:eb5d58cb-e8b8-fc6b-5992-a25e83e8d2e6@openssl.org" target="_blank">eb5d58cb-e8b8-fc6b-5992-a25e83e8d2e6@openssl.org</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
<br>
<br>
On 24/10/2018 13:25, ramakrushna mishra wrote:<br>
> Hi All,<br>
> <br>
> Thank you for all for providing the information.<br>
> I suspect we are using " SSL_MODE_SEND_FALLBACK_SCSV??" and that might<br>
> be causing the issue.? The team is looking into this issue now with the<br>
> provided information.?<br>
> <br>
> ?One doubt that came during? our investigation is :<br>
> " If client has highest version of TLS1.3 and server has support for<br>
> TLS1.2 and SLV3 only.? ?How the handshake will? proceed ? " <br>
<br>
The protocol will negotiate the highest commonly supported protocol<br>
version. So if the server supports TLS1.3 and the client only supports<br>
TLS1.2 then TLS1.2 will be used. Don't use SSLv3. That is disabled by<br>
default in current OpenSSL versions.<br>
<br>
Matt<br>
<br>
> I am not sure if this question should go to a new thread ?<br>
> <br>
> Thanks and Regards,<br>
> Ram Krushna<br>
> <br>
> On Wed, Oct 24, 2018 at 11:47 AM <<a href="mailto:openssl-users-request@openssl.org" target="_blank">openssl-users-request@openssl.org</a><br>
> <mailto:<a href="mailto:openssl-users-request@openssl.org" target="_blank">openssl-users-request@openssl.org</a>>> wrote:<br>
> <br>
>     Send openssl-users mailing list submissions to<br>
>     ? ? ? ? <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>><br>
> <br>
>     To subscribe or unsubscribe via the World Wide Web, visit<br>
>     ? ? ? ? <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
>     or, via email, send a message with subject or body 'help' to<br>
>     ? ? ? ? <a href="mailto:openssl-users-request@openssl.org" target="_blank">openssl-users-request@openssl.org</a><br>
>     <mailto:<a href="mailto:openssl-users-request@openssl.org" target="_blank">openssl-users-request@openssl.org</a>><br>
> <br>
>     You can reach the person managing the list at<br>
>     ? ? ? ? <a href="mailto:openssl-users-owner@openssl.org" target="_blank">openssl-users-owner@openssl.org</a><br>
>     <mailto:<a href="mailto:openssl-users-owner@openssl.org" target="_blank">openssl-users-owner@openssl.org</a>><br>
> <br>
>     When replying, please edit your Subject line so it is more specific<br>
>     than "Re: Contents of openssl-users digest..."<br>
> <br>
> <br>
>     Today's Topics:<br>
> <br>
>     ? ?1. Re: CAPI-Engine doc (Selva Nair)<br>
>     ? ?2. Re: CAPI-Engine doc (Michael Wojcik)<br>
>     ? ?3. Re: Reg issue in alert message (Michael Wojcik)<br>
>     ? ?4. Re: CAPI-Engine doc (Jakob Bohm)<br>
>     ? ?5. Re: Openssl Build Error- module unsafe for SAFESEH<br>
>     ? ? ? image/Unable to generate SAFESEH image (sakdev)<br>
> <br>
> <br>
>     ----------------------------------------------------------------------<br>
> <br>
>     Message: 1<br>
>     Date: Tue, 23 Oct 2018 11:22:04 -0400<br>
>     From: Selva Nair <<a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a> <mailto:<a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a>>><br>
>     To: <a href="mailto:richard.oehlinger@adbsafegate.com" target="_blank">richard.oehlinger@adbsafegate.com</a><br>
>     <mailto:<a href="mailto:richard.oehlinger@adbsafegate.com" target="_blank">richard.oehlinger@adbsafegate.com</a>>,<br>
>     <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>><br>
>     Subject: Re: [openssl-users] CAPI-Engine doc<br>
>     Message-ID:<br>
>     ? ? ? ?<br>
>     <CAKuzo_iqEBP-QG19Hsg5dFVoUG+2q-5O=<a href="mailto:vfg_NTzAJsQj%2BD3Jw@mail.gmail.com" target="_blank">vfg_NTzAJsQj+D3Jw@mail.gmail.com</a><br>
>     <mailto:<a href="mailto:vfg_NTzAJsQj%252BD3Jw@mail.gmail.com" target="_blank">vfg_NTzAJsQj%2BD3Jw@mail.gmail.com</a>>><br>
>     Content-Type: text/plain; charset="UTF-8"<br>
> <br>
>     On Tue, Oct 23, 2018 at 10:38 AM Richard Oehlinger via openssl-users<br>
>     <<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>>> wrote:<br>
>     ><br>
>     > Hi!<br>
>     ><br>
>     > I'm trying to get a handle on the CAPI engine, because I need to<br>
>     have a<br>
>     > secure Keystore on Windows. Furthermore I need it to work with Qt's<br>
>     > QSslKey, which fortunately can be constructed by EVP_PKEY *.<br>
>     ><br>
>     > So far so good. The key is found, but when I try to use it in a SSL<br>
>     > connection i get following error:<br>
>     ><br>
>     > error:80070063:lib(128):CAPI_RSA_SIGN:cant create hash object,<br>
>     > error:1409B006:SSL routines:ssl3_send_server_key_exchange:EVP lib<br>
> <br>
>     Which version of OpenSSL?<br>
> <br>
>     > Trace Output is:<br>
>     ><br>
>     > Setting debug file to C:\Users\user\AppData\Local\Temp\engine.txt<br>
>     > Opening certificate store MY<br>
>     > capi_get_key, contname={4EBA52A8-AB4B-47DB-B777-2B26351F324C},<br>
>     > provname=Microsoft Enhanced Cryptographic Provider v1.0, type=1<br>
>     > Called CAPI_rsa_sign()<br>
> <br>
>     This CSP cannot do SHA2 hashes so won't work unless you restrict<br>
>     signature algorithms or set TLS version to 1.1. I believe OpenSSL<br>
>     1.1.0 will try to load The ".. Enhanced RSA AES .. Provider" which<br>
>     can handle SHA2 and may work. I say "may" because, if the key store is<br>
>     a legacy hardware token, it also depends on signature algorithms<br>
>     supported<br>
>     by the token and may be necessary to downgrade to TLS 1.1.<br>
> <br>
>     Selva<br>
> <br>
> <br>
>     ------------------------------<br>
> <br>
>     Message: 2<br>
>     Date: Tue, 23 Oct 2018 15:37:24 +0000<br>
>     From: Michael Wojcik <<a href="mailto:Michael.Wojcik@microfocus.com" target="_blank">Michael.Wojcik@microfocus.com</a><br>
>     <mailto:<a href="mailto:Michael.Wojcik@microfocus.com" target="_blank">Michael.Wojcik@microfocus.com</a>>><br>
>     To: "<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>>"<br>
>     <<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>>><br>
>     Subject: Re: [openssl-users] CAPI-Engine doc<br>
>     Message-ID:<br>
>     ? ? ? ?<br>
>     <<a href="mailto:DM5PR18MB1324455050CC00BD3A2DD70FF9F50@DM5PR18MB1324.namprd18.prod.outlook.com" target="_blank">DM5PR18MB1324455050CC00BD3A2DD70FF9F50@DM5PR18MB1324.namprd18.prod.outlook.com</a><br>
>     <mailto:<a href="mailto:DM5PR18MB1324455050CC00BD3A2DD70FF9F50@DM5PR18MB1324.namprd18.prod.outlook.com" target="_blank">DM5PR18MB1324455050CC00BD3A2DD70FF9F50@DM5PR18MB1324.namprd18.prod.outlook.com</a>>><br>
> <br>
>     Content-Type: text/plain; charset="Windows-1252"<br>
> <br>
>     > From: openssl-users [mailto:<a href="mailto:openssl-users-bounces@openssl.org" target="_blank">openssl-users-bounces@openssl.org</a><br>
>     <mailto:<a href="mailto:openssl-users-bounces@openssl.org" target="_blank">openssl-users-bounces@openssl.org</a>>] On Behalf<br>
>     > Of Richard Oehlinger via openssl-users<br>
>     > Sent: Tuesday, October 23, 2018 10:38<br>
>     ><br>
>     > I'm trying to get a handle on the CAPI engine, because I need to<br>
>     have a<br>
>     > secure Keystore on Windows. Furthermore I need it to work with Qt's<br>
>     > QSslKey, which fortunately can be constructed by EVP_PKEY *.<br>
> <br>
>     What OpenSSL version are you using? Please remember to include this<br>
>     informtion in every question. (And, normally, we'd ask for the<br>
>     platform as well, but since CAPI is Windows-specific, we know that<br>
>     in this case.)<br>
> <br>
>     > So far so good. The key is found, but when I try to use it in a SSL<br>
>     > connection i get following error:<br>
>     ><br>
>     > error:80070063:lib(128):CAPI_RSA_SIGN:cant create hash object,<br>
>     > error:1409B006:SSL routines:ssl3_send_server_key_exchange:EVP lib<br>
>     ><br>
>     > I use a current Windows 10. Do I need to use a different Algorithm in<br>
>     > order to work? Some googeling is indicating the provider might be<br>
>     wrong.<br>
> <br>
>     I haven't looked at the CAPI engine code since 1.0.1j. At that time,<br>
>     I needed CAPI support and discovered there were various issues with<br>
>     the extant CAPI code, so I forked and rewrote it. That was some time<br>
>     back, obviously, and I'm afraid I never got around to pushing the<br>
>     changes back to <a href="http://openssl.org" rel="noreferrer" target="_blank">openssl.org</a> <<a href="http://openssl.org" rel="noreferrer" target="_blank">http://openssl.org</a>>. (In fact, it was<br>
>     sufficiently long ago that I believe the organization was still<br>
>     reluctant to take contributions from people in the US at the time.)<br>
> <br>
>     The biggest issue was with provider handling. CAPI is something of a<br>
>     braindead API in many ways - Microsoft's replacement, CNG, is<br>
>     somewhat better - and the provider stuff is one of them. When a key<br>
>     (including a "key" which is actually just a reference to a key<br>
>     contained in an HSM) is imported into one of the Windows key stores,<br>
>     it has to be associated with a provider, and that provider has to<br>
>     accommodate that type and size of key; otherwise the key is<br>
>     unusable. Then, when you try to use the key in CAPI, you have to<br>
>     specify the same provider - CAPI isn't smart enough to figure it out<br>
>     on its own.<br>
> <br>
>     So my version of the CAPI engine has code to look up the key's<br>
>     provider and silently correct the provider type information in the<br>
>     engine's context structure if it's a mismatch.<br>
> <br>
>     Beyond that, it appears that my changes included:<br>
> <br>
>     - Support for building all the necessary functionality when using<br>
>     Microsoft Windows SDK 6.0A, which was one of my requirements at the<br>
>     time.<br>
> <br>
>     - Supporting hashes other than SHA-1 for DSA. We have US Federal<br>
>     customers who needed fairly comprehensive DSA support. For most<br>
>     people this is likely a non-issue.<br>
> <br>
>     - Forcing stack probes on for the callback functions, because my<br>
>     engine was being built outside the OpenSSL build process, but needed<br>
>     to match the calling convention of OpenSSL, which (at least in<br>
>     1.0.1j) included stack-probe support.<br>
> <br>
>     - A fix suggested by Steven Henson years ago on the mailing list to<br>
>     capi_get_key, but never (at least by 1.0.1j) picked up in the source<br>
>     code: If CryptGetUserKey returns NTE_NO_KEY, xor keyspec with 3 to<br>
>     flip the key type and try CryptGetUesrKey again.<br>
> <br>
>     I think that's it, though it's possible I tweaked some other things<br>
>     and didn't call them out in the comments.<br>
> <br>
>     I suppose I should check what the CAPI engine source looks like in<br>
>     1.1.1, merge my changes in if feasible, and submit a PR. One of<br>
>     these days...<br>
> <br>
>     Really, though, what we need is a new engine written to use CNG<br>
>     rather than CAPI. Though that would have the disadvantage of not<br>
>     supporting ancient Windows OS and SDK versions which, while<br>
>     unsupported by Microsoft, are still used in far too many places.<br>
> <br>
>     --<br>
>     Michael Wojcik<br>
>     Distinguished Engineer, Micro Focus<br>
> <br>
> <br>
> <br>
> <br>
>     ------------------------------<br>
> <br>
>     Message: 3<br>
>     Date: Tue, 23 Oct 2018 15:37:25 +0000<br>
>     From: Michael Wojcik <<a href="mailto:Michael.Wojcik@microfocus.com" target="_blank">Michael.Wojcik@microfocus.com</a><br>
>     <mailto:<a href="mailto:Michael.Wojcik@microfocus.com" target="_blank">Michael.Wojcik@microfocus.com</a>>><br>
>     To: "<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>>"<br>
>     <<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>>><br>
>     Subject: Re: [openssl-users] Reg issue in alert message<br>
>     Message-ID:<br>
>     ? ? ? ?<br>
>     <<a href="mailto:DM5PR18MB13246F528FB866508D8E9267F9F50@DM5PR18MB1324.namprd18.prod.outlook.com" target="_blank">DM5PR18MB13246F528FB866508D8E9267F9F50@DM5PR18MB1324.namprd18.prod.outlook.com</a><br>
>     <mailto:<a href="mailto:DM5PR18MB13246F528FB866508D8E9267F9F50@DM5PR18MB1324.namprd18.prod.outlook.com" target="_blank">DM5PR18MB13246F528FB866508D8E9267F9F50@DM5PR18MB1324.namprd18.prod.outlook.com</a>>><br>
> <br>
>     Content-Type: text/plain; charset="Windows-1252"<br>
> <br>
>     > From: openssl-users [mailto:<a href="mailto:openssl-users-bounces@openssl.org" target="_blank">openssl-users-bounces@openssl.org</a><br>
>     <mailto:<a href="mailto:openssl-users-bounces@openssl.org" target="_blank">openssl-users-bounces@openssl.org</a>>] On Behalf<br>
>     > Of Viktor Dukhovni<br>
>     > Sent: Tuesday, October 23, 2018 10:02<br>
>     ><br>
>     > On Tue, Oct 23, 2018 at 01:29:27PM +0100, Matt Caswell wrote:<br>
>     ><br>
>     > > > So, I think client have set TLS_FALLBACK_SCSV in cipher suite<br>
>     list in<br>
>     > > > client hello.<br>
>     > ><br>
>     > > This suggests there is a bug in the client application. This can<br>
>     only<br>
>     > > happen if the client application calls SSL_CTX_set_mode() or<br>
>     > > SSL_set_mode() to set the SSL_MODE_SEND_FALLBACK_SCSV mode.<br>
>     ><br>
>     > I have a somewhat plausible, if dicey hunch:<br>
>     ><br>
>     >? ? ?Perhaps some application developers got confused between<br>
>     >? ? ?the similar functions SSL_CTX_set_session_cache_mode(3)<br>
>     >? ? ?and SSL_CTX_set_mode(3) and called the wrong one?<br>
> <br>
>     Certainly possible, but I wouldn't discount the possibility that<br>
>     someone simply thought setting SSL_MODE_SEND_FALLBACK_SCSV was the<br>
>     Right Thing. There was a fair bit of confusion around the Fallback<br>
>     SCSV when it first appeared (we had questions from customers that<br>
>     indicated they didn't understand it, and I had to read the ID to<br>
>     make sure I did). And, of course, TLS is mightly confusing in general.<br>
> <br>
>     It is interesting to note that those two options happen to have the<br>
>     same value, though, particularly given the similarity of the two<br>
>     function names.<br>
> <br>
>     This is one of those cases where C's weak type system is a problem.<br>
>     Though it would be nice if OpenSSL used enums rather than macros for<br>
>     these things.<br>
> <br>
>     --<br>
>     Michael Wojcik<br>
>     Distinguished Engineer, Micro Focus<br>
> <br>
> <br>
> <br>
> <br>
> <br>
>     ------------------------------<br>
> <br>
>     Message: 4<br>
>     Date: Tue, 23 Oct 2018 17:42:56 +0200<br>
>     From: Jakob Bohm <<a href="mailto:jb-openssl@wisemo.com" target="_blank">jb-openssl@wisemo.com</a> <mailto:<a href="mailto:jb-openssl@wisemo.com" target="_blank">jb-openssl@wisemo.com</a>>><br>
>     To: <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>><br>
>     Subject: Re: [openssl-users] CAPI-Engine doc<br>
>     Message-ID: <<a href="mailto:fc161e84-bf5f-f61b-0f1d-3bfa5641edd8@wisemo.com" target="_blank">fc161e84-bf5f-f61b-0f1d-3bfa5641edd8@wisemo.com</a><br>
>     <mailto:<a href="mailto:fc161e84-bf5f-f61b-0f1d-3bfa5641edd8@wisemo.com" target="_blank">fc161e84-bf5f-f61b-0f1d-3bfa5641edd8@wisemo.com</a>>><br>
>     Content-Type: text/plain; charset=utf-8; format=flowed<br>
> <br>
>     On 23/10/2018 17:22, Selva Nair wrote:<br>
>     > On Tue, Oct 23, 2018 at 10:38 AM Richard Oehlinger via openssl-users<br>
>     > <<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>>> wrote:<br>
>     >> Hi!<br>
>     >><br>
>     >> I'm trying to get a handle on the CAPI engine, because I need to<br>
>     have a<br>
>     >> secure Keystore on Windows. Furthermore I need it to work with Qt's<br>
>     >> QSslKey, which fortunately can be constructed by EVP_PKEY *.<br>
>     >><br>
>     >> So far so good. The key is found, but when I try to use it in a SSL<br>
>     >> connection i get following error:<br>
>     >><br>
>     >> error:80070063:lib(128):CAPI_RSA_SIGN:cant create hash object,<br>
>     >> error:1409B006:SSL routines:ssl3_send_server_key_exchange:EVP lib<br>
>     > Which version of OpenSSL?<br>
>     ><br>
>     >> Trace Output is:<br>
>     >><br>
>     >> Setting debug file to C:\Users\user\AppData\Local\Temp\engine.txt<br>
>     >> Opening certificate store MY<br>
>     >> capi_get_key, contname={4EBA52A8-AB4B-47DB-B777-2B26351F324C},<br>
>     >> provname=Microsoft Enhanced Cryptographic Provider v1.0, type=1<br>
>     >> Called CAPI_rsa_sign()<br>
>     > This CSP cannot do SHA2 hashes so won't work unless you restrict<br>
>     > signature algorithms or set TLS version to 1.1. I believe OpenSSL<br>
>     > 1.1.0 will try to load The ".. Enhanced RSA AES .. Provider" which<br>
>     > can handle SHA2 and may work. I say "may" because, if the key store is<br>
>     > a legacy hardware token, it also depends on signature algorithms<br>
>     supported<br>
>     > by the token and may be necessary to downgrade to TLS 1.1.<br>
>     ><br>
>     The above limitations are less severe in CNG ("CryptoAPI Next<br>
>     Generation")<br>
>     on Windows 6.00 and later, where the old API and CSP names are actually<br>
>     emulations on top of a new structure with much smaller "KSP" providers.<br>
>     At the same time, the CNG emulation of the classic CryptoAPI functions<br>
>     are limited to what was available in Windows 5.01 SP2 and 5.02 SP2, thus<br>
>     much of the SHA-2 functionality is available only by calling the CNG<br>
>     APIs directly on Windows >= 6.00, but the older APIs with a reference<br>
>     to newer enum values introduced in Windows 5.01 SP3 or 5.02 SP2+Hotfix.<br>
> <br>
>     Put another way, Microsoft forked their crypto source tree sometime in<br>
>     2004 or 2005, and anything added later was implemented differently in<br>
>     the 5.0x and 6.0x code bases.<br>
> <br>
>     Enjoy<br>
> <br>
>     Jakob<br>
>     -- <br>
>     Jakob Bohm, CIO, Partner, WiseMo A/S.? <a href="https://www.wisemo.com" rel="noreferrer" target="_blank">https://www.wisemo.com</a><br>
>     Transformervej 29, 2860 S?borg, Denmark.? Direct +45 31 13 16 10<br>
>     This public discussion message is non-binding and may contain errors.<br>
>     WiseMo - Remote Service Management for PCs, Phones and Embedded<br>
> <br>
> <br>
> <br>
>     ------------------------------<br>
> <br>
>     Message: 5<br>
>     Date: Tue, 23 Oct 2018 23:16:13 -0700 (MST)<br>
>     From: sakdev <<a href="mailto:best.sakthi3@gmail.com" target="_blank">best.sakthi3@gmail.com</a> <mailto:<a href="mailto:best.sakthi3@gmail.com" target="_blank">best.sakthi3@gmail.com</a>>><br>
>     To: <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>><br>
>     Subject: Re: [openssl-users] Openssl Build Error- module unsafe for<br>
>     ? ? ? ? SAFESEH image/Unable to generate SAFESEH image<br>
>     Message-ID: <<a href="mailto:1540361773425-0.post@n7.nabble.com" target="_blank">1540361773425-0.post@n7.nabble.com</a><br>
>     <mailto:<a href="mailto:1540361773425-0.post@n7.nabble.com" target="_blank">1540361773425-0.post@n7.nabble.com</a>>><br>
>     Content-Type: text/plain; charset=us-ascii<br>
> <br>
>     Added "/safeseh" in assembler flags and problem got solved. Thank<br>
>     you very<br>
>     much.<br>
> <br>
> <br>
> <br>
>     --<br>
>     Sent from: <a href="http://openssl.6102.n7.nabble.com/OpenSSL-User-f3.html" rel="noreferrer" target="_blank">http://openssl.6102.n7.nabble.com/OpenSSL-User-f3.html</a><br>
> <br>
> <br>
>     ------------------------------<br>
> <br>
>     Subject: Digest Footer<br>
> <br>
>     _______________________________________________<br>
>     openssl-users mailing list<br>
>     <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a> <mailto:<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>><br>
>     <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
> <br>
> <br>
>     ------------------------------<br>
> <br>
>     End of openssl-users Digest, Vol 47, Issue 45<br>
>     *********************************************<br>
> <br>
> <br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 24 Oct 2018 23:55:23 +0900<br>
From: Akira Takahashi <<a href="mailto:takahashi.akira.58s@kyoto-u.jp" target="_blank">takahashi.akira.58s@kyoto-u.jp</a>><br>
To: <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a><br>
Subject: [openssl-users] Using SM2 ECIES in 1.1.1<br>
Message-ID: <<a href="mailto:f4163a25-e9b6-f60b-b3ea-8aadf2c190fe@kyoto-u.jp" target="_blank">f4163a25-e9b6-f60b-b3ea-8aadf2c190fe@kyoto-u.jp</a>><br>
Content-Type: text/plain; charset=utf-8; format=flowed<br>
<br>
Hi all,<br>
<br>
<br>
Since the version 1.1.1 supports the SM2 public key cryptography suite I am <br>
trying to test its ECIES (found in crypto/sm2/sm2_crypto.c) over different <br>
standardized prime curves i.e. not just sm2p256v1.<br>
<br>
Is there CLI or minimal code snippet to achieve it via the EVP interface?<br>
<br>
The current man page of SM2 seems to only describe SM2 as a signature algorithm, <br>
but not as a public key encryption.<br>
<br>
<br>
Thank you in advance for your help!<br>
<br>
Akira<br>
<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 24 Oct 2018 16:14:47 +0100<br>
From: Matt Caswell <<a href="mailto:matt@openssl.org" target="_blank">matt@openssl.org</a>><br>
To: <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a><br>
Subject: Re: [openssl-users] Using SM2 ECIES in 1.1.1<br>
Message-ID: <<a href="mailto:92097423-88c0-5a7d-9395-a84195b257d6@openssl.org" target="_blank">92097423-88c0-5a7d-9395-a84195b257d6@openssl.org</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
<br>
<br>
On 24/10/2018 15:55, Akira Takahashi wrote:<br>
> Hi all,<br>
> <br>
> <br>
> Since the version 1.1.1 supports the SM2 public key cryptography suite I<br>
> am trying to test its ECIES (found in crypto/sm2/sm2_crypto.c) over<br>
> different standardized prime curves i.e. not just sm2p256v1.<br>
> <br>
> Is there CLI or minimal code snippet to achieve it via the EVP interface?<br>
> <br>
> The current man page of SM2 seems to only describe SM2 as a signature<br>
> algorithm, but not as a public key encryption.<br>
<br>
You can use the EVP_PKEY_encrypt() function for this purpose.<br>
<br>
A generic example (not SM2 specific) is on the EVP_PKEY_encrypt() man page:<br>
<br>
<a href="https://www.openssl.org/docs/man1.1.1/man3/EVP_PKEY_encrypt.html" rel="noreferrer" target="_blank">https://www.openssl.org/docs/man1.1.1/man3/EVP_PKEY_encrypt.html</a><br>
<br>
Doing this for SM2 is essentially the same as shown in that example<br>
except of course don't call the RSA specific<br>
EVP_PKEY_CTX_set_rsa_padding() function.<br>
<br>
Setting up of the EVP_PKEY itself to contain an SM2 key is the same as<br>
for sign/verify, i.e. you need to call EVP_PKEY_set_alias_type(). There<br>
is no need to set an id though. See:<br>
<br>
<a href="https://www.openssl.org/docs/man1.1.1/man7/SM2.html" rel="noreferrer" target="_blank">https://www.openssl.org/docs/man1.1.1/man7/SM2.html</a><br>
<br>
Hope that helps,<br>
<br>
Matt<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Wed, 24 Oct 2018 21:42:49 +0500<br>
From: ???? ????????? <<a href="mailto:socketpair@gmail.com" target="_blank">socketpair@gmail.com</a>><br>
To: <a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a><br>
Subject: [openssl-users] openssl cms encrypt recipientInfo [questions<br>
        for     openssl developers].<br>
Message-ID:<br>
        <<a href="mailto:CAEmTpZF9hUxy6fQyX%2BZNgs-HBJiw6nxGVanXXix-vA8D8HgLXg@mail.gmail.com" target="_blank">CAEmTpZF9hUxy6fQyX+ZNgs-HBJiw6nxGVanXXix-vA8D8HgLXg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="UTF-8"<br>
<br>
Here is a dump of my CMS encrypted message.<br>
<br>
===================<br>
CMS_ContentInfo:.<br>
  contentType: pkcs7-envelopedData (1.2.840.113549.1.7.3)<br>
  d.envelopedData:.<br>
    version: 2<br>
    originatorInfo: <ABSENT><br>
    recipientInfos:<br>
      d.kari:.<br>
        version: 3<br>
        d.originatorKey:.<br>
          algorithm:.<br>
            algorithm: id-ecPublicKey (1.2.840.10045.2.1)<br>
            parameter: <ABSENT><br>
          publicKey:  (0 unused bits)<br>
            0000 - 04 89 ee 81 d8 05 30 2d-4e 3a a3 33 dd 8b   ......0-N:.3..<br>
            000e - c5 7d 56 79 02 2b 16 7a-f5 4c 20 3f 18 ed   .}Vy.+.z.L ?..<br>
            001c - 92 ba 81 98 88 f8 7a 6c-41 ba 8e bb c0 a5   ......zlA.....<br>
            002a - 41 c4 2a fe 36 31 5c f3-92 9c b5 ad 79 a9   A.*.61\.....y.<br>
            0038 - 9c 4c 75 69 23 9d a1 5b-ef                  .Lui#..[.<br>
        ukm: <ABSENT><br>
        keyEncryptionAlgorithm:.<br>
          algorithm: dhSinglePass-stdDH-sha256kdf-scheme (1.3.132.1.11.1)<br>
          parameter: SEQUENCE:<br>
        recipientEncryptedKeys:<br>
            d.rKeyId:.<br>
              subjectKeyIdentifier:.<br>
                0000 - 82 46 4f ae b4 cb 84 7b-f4 70 68 6f d0   .FO....{.pho.<br>
                000d - 24 e7 15 8c 34 f3 c4                     $...4..<br>
              date: <ABSENT><br>
              other: <ABSENT><br>
            encryptedKey:.<br>
              0000 - f9 b1 b1 28 2a 0c ea e5-eb 3b 0f 22 a5 f4   ...(*....;."..<br>
              000e - 51 8e 22 a3 76 4f fe 01-6f 26 37 b5 24 1c   Q.".vO..o&7.$.<br>
              001c - 20 ba 9f 1a 11 92 25 a5-e4 4e 79 6f          .....%..Nyo<br>
    encryptedContentInfo:.<br>
      contentType: pkcs7-data (1.2.840.113549.1.7.1)<br>
      contentEncryptionAlgorithm:.<br>
        algorithm: aes-256-cbc (2.16.840.1.101.3.4.1.42)<br>
        parameter: OCTET STRING:<br>
          0000 - c4 12 53 6c 1f 04 ee 3a-2f 19 43 6f 87 0c af   ..Sl...:/.Co...<br>
          000f - 9b                                             .<br>
      encryptedContent:.<br>
        0000 - 9f 18 ea 29 08 26 f5 8c-7c 69 ae 23 f2 ca 95   ...).&..|i.#...<br>
        000f - 76                                             v<br>
    unprotectedAttrs:<br>
      <EMPTY><br>
========<br>
<br>
As you can see it has reference to one recipient, identified by his<br>
subjectKeyIdentifier. By some reason<br>
RecipientInfos/d.kari/d.originatorKey also includes full public key<br>
from recipient's certificate. Questions:<br>
<br>
1. Why is it required?<br>
2. Is it possible to omit it since it is superfluous (IMHO) ?<br>
3. <a href="https://github.com/openssl/openssl/blob/master/crypto/cms/cms_kari.c#L386" rel="noreferrer" target="_blank">https://github.com/openssl/openssl/blob/master/crypto/cms/cms_kari.c#L386</a><br>
(and RFC) say that there could be either key, subjectandserial or<br>
subjectkeyidentifier. So, how to set it using command line openssl<br>
application ?<br>
<br>
-- <br>
Segmentation fault<br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
openssl-users mailing list<br>
<a href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a><br>
<a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
<br>
<br>
------------------------------<br>
<br>
End of openssl-users Digest, Vol 47, Issue 47<br>
*********************************************<br>
</blockquote></div></div></div>