On 03/17/2011 06:01 AM, Vic Lee wrote:
> On 03/17/2011 02:19 AM, Mads Kiilerich wrote:
>> On 03/16/2011 06:14 PM, Vic Lee wrote:
>> I would like to merge that with crypto_openssl.c, but I agree with the
>> direction of the change ;-)
>
> I don't think it's a good idea to merge them. tls.c is more readable as
> a separated file. It implements very specific TLS streaming. crypto_* is
> just a set of crypto algorithms.

Some crypto libraries requires initialization before use (see nss and 
gnutls). The individual crypto calls can thus not (easily) be used 
without considering other uses of the crypto library. I think it would 
be better to hide and abstract the crypto library in one place rather 
than two. (But obviously is shouldn't end up like ssl.c ;-) )

crypto_* might just contain a set of crypto algorithms, but from another 
point of view they implement "methods" on different kinds of crypto 
"objects" (md5, sha1, rc4, x509 certificate). I don't think a nice 
encapsulation in tls_openssl is that different from that.

But after taking a closer look at tls_openssl I see that it currently is 
at a higher level than crypto_* - but I don't think it has to be. I 
don't think struct rdp_tls should contain a rdpSec *, and it shouldn't 
call ui_check_certificate directly. It would perhaps be better if there 
was a way to retrieve a CryptoCert from a rdpTls.

It is nice to have server verification for TLS/NLA, but we also need 
something similar for old fasioned connections in 
sec_parse_server_security_data. x509 verification should be very much 
the same as used for TLS, and known_hosts should also be usable for 
"server proprietary certificates". It seems like 
tls_verify_peer_identity has a lot in common with what 
crypto_cert_verify should have been, so they should perhaps be 
consolidated and refactored in crypto_*?

SHA1 fingerprints of certificates are usually separated with ':' (for 
example in firefox) - I think it would be better to use that instead of '-'.

>> Before that I would like to have all references to openssl removed from
>> credssp.c and encapsulated in *_openssl.c.
>
> credssp.c is already done (actually the only function left in it was
> credssp_nonce and I moved it to crypto_nonce). However ntlmssp.c still
> has a lot of stuff that depends on openssl and it seems not trivial to move.

It no longer needs rand and engine, so we "just" need to encapsulate 
des, md4 and hmac in crypto. That should be feasible.

/Mads

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Freerdp-devel mailing list
Freerdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to