Nelson B Bolyard wrote:
> Ruchi Lohani wrote, On 2008-08-20 21:31:
>> Thanks Nelson.
>> And sorry about the subject of the mail. I wanted to ask about that also.
>> What are the equivalent APIs in NSS which probably can replace the BIO
>> I/O abstraction of OpenSSL ?
>
> Years have elapsed since I last looked at the BIO functions, but I believe
> the NSPR PR_ functions (e.g. PR_Open, PR_Close, PR_NewTCPSocket, PR_Read,
> PR_Write, PR_Send, PR_Recv, etc.) are what you want.

A working example showing how to import an OS-native file descriptor into the 
NSPR framework is provided here:

https://bugzilla.mozilla.org/attachment.cgi?id=334117

That plugs NSPR/PSM into OpenLDAP's sockbuf handler (which is the moral 
equivalent of both BIOs and NSPR fds...)

Likewise you can look at the sockbuf support in OpenLDAP here
http://www.openldap.org/devel/cvsweb.cgi/libraries/libldap/
and compare the sockbuf interface to BIOs in tls_o.c with the sockbuf 
interface to NSPR in tls_m.c. This is a more extensive example because it 
sandwiches the SSL layers from both top and bottom; i.e. there is a sockbuf 
layer that sits above the SSL layer (between libldap and the SSL library), and 
another sockbuf layer below the SSL layer (between the SSL library and the 
network).
-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/
_______________________________________________
dev-tech-crypto mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to