Hello,

Given only a NSPR file descriptor, what would be the correct way to
see if:

1) TLS functionality has been layered on the file descriptor stack?
2) The TLS handshake has been done with the host on the remote end of
the socket connection?

For 1), can I use the PR_GetDescType() from the NSPR API?  For TCP
socket, I guess the type should be PR_DESC_SOCKET_TCP and for a TLS
socket, it would be PR_DESC_LAYERED.  Here, I am assuming that only
SSL can be layered on top of the TLS socket (which in my project seems
to be a valid assumption).

What can I use for 2)?  I can't seem to invoke any of the SSL API
functions because they all use ssl_FindSocket to match the PRFileDesc*
to a sslSocket structure.  However, ssl_FindSocket seems to die very
ungracefully when it receives a non-TLS PRFileDesc and returns a
segmentation fault on a Linux platform.  Shouldn't ssl_FindSocket
return an error code instead of a segmentation fault?

Regards,
Peter

_______________________________________________
dev-tech-crypto mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to