<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I see. I appreciate your willingness to help, but it would've been far better if you answered those very specific and unambiguous questions that I explicitly asked, instead of trying to guess/conjecture what the high level purpose of that whole exercise was. </div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">As it happens, I've no interest and no need for (other) remote login or virtualization solutions (which have nothing to do with the problem I'm addressing), so I am unable to make use of your answer.<br><br>Regards,<div>Uri</div><div><br></div><div>Sent from my iPhone</div></div><div><br>On Apr 28, 2017, at 18:37, Ryan Murray <<a href="mailto:rjkmurray40@gmail.com">rjkmurray40@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Monaco;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.p1, li.p1, div.p1
        {mso-style-name:p1;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Monaco;}
p.p4, li.p4, div.p4
        {mso-style-name:p4;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Monaco;
        color:#793D93;}
span.s1
        {mso-style-name:s1;
        mso-style-type:personal;
        color:#793D93;}
span.s2
        {mso-style-name:s2;
        mso-style-type:personal;
        color:#931A68;}
span.s3
        {mso-style-name:s3;
        mso-style-type:personal;
        color:black;}
span.s5
        {mso-style-name:s5;
        mso-style-type:personal;
        color:#006141;}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><div class="WordSection1"><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"> </p><p class="MsoNormal"> REMOTE LOGIN PROTOCOLS  </p><p class="MsoNormal">A client/server model can create a mechanism that allows a user to establish a session  on the remote machine and then run its applications. This application is known as  remote login. This can be done by a client/server application program for the desired  service. Two remote login protocols are TELNET and SSH.  TELNET Protocol  TELNET (terminal network) is a TCP/IP standard for establishing a connection to a  remote system. TELNET allows a user to log in to a remote machine across the  Internet by first making a TCP connection and then pass the detail of the application  </p><p class="MsoNormal"> from the user to the remote machine.. You do this to many</p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class="MsoNormal"><o:p> </o:p></p><div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:uri@ll.mit.edu">Blumenthal, Uri - 0553 - MITLL</a><br><b>Sent: </b>Friday, April 28, 2017 4:33 PM<br><b>To: </b><a href="mailto:openssl-users@openssl.org">openssl-users@openssl.org</a><br><b>Subject: </b>[openssl-users] EVP_MD_CTX and EVP_PKEY_CTX? How to init? How tofree?</p></div><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">I’m playing with RSA-PSS signatures, and stumbled upon a few problems. I tried the OpenSSL manual pages, but still coming short of complete understanding. :-)<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">This is how I initialize the contexts (error handlers removed for brevity):<o:p></o:p></p><p class="p1"><span class="apple-tab-span"><o:p> </o:p></span></p><p class="p1"><span class="apple-tab-span">      </span>ctx = <span class="s1">EVP_PKEY_CTX_new</span>(privkey, NULL);</p><p class="p4"><span class="apple-tab-span">      </span><span class="s3">md_ctx = </span>EVP_MD_CTX_create<span class="s3">();</span></p><p class="p1"><span class="apple-tab-span">      </span><span class="s2">const</span> <span class="s5">EVP_MD</span> *md = <span class="s1">EVP_sha256</span>();</p><p class="p1"><span class="apple-tab-span">      </span>rv = <span class="s1">EVP_DigestInit_ex</span>(md_ctx, md, NULL);</p><p class="p1"><span class="apple-tab-span">      </span>rv = <span class="s1">EVP_DigestSignInit</span>(md_ctx, &ctx, md, NULL, privkey);</p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">First question: do I need <span style="font-family:Monaco">EVP_DigestInit_ex()</span> there?<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Second question: do I have to specify hash-function (<span style="font-family:Monaco">EVP_MD*</span>) twice? First when initializing <span style="font-family:Monaco">EVP_MD_CTX</span>, and second for <span style="font-family:Monaco">EVP_DigestSignInit()</span>?<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">At the end I need to dispose of both <span style="font-family:Monaco">ctx</span> and <span style="font-family:Monaco">md_ctx</span>. That leads to my third question/problem. The code I tried (based on what the man page says: to avoid memory leak, I need to do <span style="font-family:Monaco">EVP_MD_CTX_destroy(md_ctx)</span> crashes with SIGV:<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:Monaco;color:black">      </span><span style="font-size:10.5pt;font-family:Monaco;color:#793D93">EVP_MD_CTX_destroy</span><span style="font-size:10.5pt;font-family:Monaco;color:black">(md_ctx); // this succeeds</span><span style="font-size:10.5pt;font-family:Monaco;color:#793D93"><o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:Monaco;color:black">      </span><span style="font-size:10.5pt;font-family:Monaco;color:#793D93">EVP_PKEY_CTX_free</span><span style="font-size:10.5pt;font-family:Monaco;color:black">(ctx);  // but here the code crashes</span><span style="font-size:10.5pt;font-family:Monaco;color:#793D93"><o:p></o:p></span></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Same happens when I reverse the above order:<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:Monaco;color:black">      </span><span style="font-size:10.5pt;font-family:Monaco;color:#793D93">EVP_PKEY_CTX_free</span><span style="font-size:10.5pt;font-family:Monaco;color:black">(ctx); // this succeeds</span><span style="font-size:10.5pt;font-family:Monaco;color:#793D93"><o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:Monaco;color:black">      </span><span style="font-size:10.5pt;font-family:Monaco;color:#793D93">EVP_MD_CTX_destroy</span><span style="font-size:10.5pt;font-family:Monaco;color:black">(md_ctx); // but then this one causes crash</span><span style="font-size:10.5pt;font-family:Monaco;color:#793D93"><o:p></o:p></span></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">So what’s the correct way of freeing both of them? Or is it that because they’re sort of “bound together” by <span class="s1">EVP_DigestSignInit</span>(md_ctx, &ctx, md, NULL, privkey); freeing one frees the other?<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Thanks!<o:p></o:p></p><p class="MsoNormal"><span style="font-size:10.5pt;color:black">— <o:p></o:p></span></p><div><p class="MsoNormal"><span style="font-size:10.5pt;color:black">Regards,<o:p></o:p></span></p></div><div><p class="MsoNormal"><span style="font-size:10.5pt;color:black">Uri<o:p></o:p></span></p></div><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><o:p> </o:p></p></div></div></blockquote><blockquote type="cite"><div><span>-- </span><br><span>openssl-users mailing list</span><br><span>To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users">https://mta.openssl.org/mailman/listinfo/openssl-users</a></span><br></div></blockquote></body></html>