<div dir="ltr"><div><div>Thanks Ben for the reply.<br><br></div>I tried the following, and the code hits the block as commented ::<br><br><br>###########################################################################<br>static char inter_bio_buf[1000];<br>static char network_bio_buf[1000];<br><br>{<br>        BIO *inter_bio_buf_bio = NULL, *network_bio_buf_bio = NULL;<br><br>        inter_bio_buf_bio = BIO_new_mem_buf(inter_bio_buf, sizeof(inter_bio_buf));<br>        if(inter_bio_buf_bio == NULL)<br>        {<br></div>            /* Control does not reach here. */<br><div>        }<br><br>        network_bio_buf_bio = BIO_new_mem_buf(network_bio_buf, sizeof(network_bio_buf));<br>        if(network_bio_buf_bio == NULL)<br>        {<br>            /* Control does not reach here. */<br>        }<br><br>        if(!BIO_make_bio_pair(inter_bio_buf_bio, network_bio_buf_bio))<br>        {<br>            /* CONTROL REACHES HERE. */<br>        }<br>}<br>############################################################################<br><br></div><div>What am I doing wrong?<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 12, 2016 at 12:59 AM, Benjamin Kaduk <span dir="ltr"><<a href="mailto:bkaduk@akamai.com" target="_blank">bkaduk@akamai.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span class="">
    On 10/11/2016 02:06 PM, Ajay Garg wrote:<br>
    <blockquote type="cite">
      
      <div dir="ltr"><span style="font-family:arial,helvetica,sans-serif">Hi All.<br>
          <br>
        </span>
        <div><span style="font-family:arial,helvetica,sans-serif"><br>
          </span></div>
        <div><span style="font-family:arial,helvetica,sans-serif">a)<br>
          </span></div>
        <div><span style="font-family:arial,helvetica,sans-serif">In the
            call,<br>
          </span>
          <pre class="m_8947789158244903202gmail-code"><span style="font-family:arial,helvetica,sans-serif">                      int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, BIO **bio2, size_t writebuf2);

are internal-buffers malloc'ed for each of "bio1" and "bio2"?
</span></pre>
          <pre class="m_8947789158244903202gmail-code"><span style="font-family:arial,helvetica,sans-serif">If yes, is there a way to pass buffers from the application-layer?
I ask this, because not all systems possess dynamic-memory allocation (or at least "malloc" is not available on all systems).

</span></pre>
          <pre class="m_8947789158244903202gmail-code"><span style="font-family:arial,helvetica,sans-serif">b)
Irrespective of the values of "writebuf1" and "writebuf2" in a), I see that everything works perfect.
So, there's got to be some internal-buffer that manages the complete ssl-packet, most probably instantiated via the call

                      BIO* BIO_new(BIO_f_ssl());

</span></pre>
          <pre class="m_8947789158244903202gmail-code"><span style="font-family:arial,helvetica,sans-serif">Here too, is it possible to pass the buffer from application-layer (because of same reasons as above)?</span>
</pre>
        </div>
      </div>
    </blockquote>
    <br>
    <br></span>
    You should be able to produce the desired effect with
    BIO_new_mem_buf() (twice) and attaching the resulting BIOs to each
    other with BIO_make_bio_pair().<br>
    <br>
    -Ben<br>
  </div>

<br>--<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/<wbr>mailman/listinfo/openssl-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Regards,<br>Ajay<br></div>
</div>