RFC 2246 PRF function in PHP
<p>I've been looking all over for an implementation of the PRF function from RFC 2246. I've found three. One <a href="http://stackoverflow.com/questions/13324785/openssl-prf-function">here</a>, one from the openSSL library, and one from wpa_supplicant. They all return different results. So my first question is: is there sample PRF input and sample PRF output somewhere?</p>

<p>That function is part of connecting to a .NET web service (protected with WS-Security) from PHP.</p>

<p>What I've found so far is this. My client sends a request for a token first with a username/password and a nonce -- that's an RST. The server, in its RSTR, responds with another nonce and a security token. The next request from my client should come with a signature whose key is derived from the two nonces and a "master secret". That derived key is computed according to RFC 2246. And that's why I need a reliable implementation of it.</p>

<p>Even if I have a reliable implementation of it, what would constitute the parameters to that function in the context of WS-Security? The PRF function should take three parameters, i.e.:</p>

<p><strong>secret, label, seed.</strong></p>

<p>I've read <a href="http://www.codeproject.com/Articles/16427/Digging-into-SecureConversation-Part-I" rel="nofollow">here</a>, that the label Microsoft uses is "WS-SecureConversationWS-SecureConversation", but that article was written in 2006... Now, what would be the secret? Is it the original password? The security token? A combination of those? Finally, what would be the seed? I have two nonce's -- do I concatenate them, OR them, XOR them?</p>

<p>I'm seriously stuck. Any help greatly appreciated.</p>
