Skip to contentSkip to conversation

Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

PATCH Jason R. Coombs 4 participants 13 messages Sep 24, 2008 – Oct 9, 2008

lore
Share & tools
lore
#0 lore raw

I'd really like to see this feature in a future build.

Is there anything more that needs to be done to integrate this into 2.1? I can help with code cleanup/refactoring. I don't have a development environment set up, though, so I'd be working blind.

Cheers,
Jason

Quoted 3 lines · On 9/23/07, Faidon Liambotis Wrote: Alon Bar-Lev wrote:
Quoted 2 lines · Faidon Liambotis
Quoted 1 line · Alon Bar-Lev

So you need to use CertVerifyCertificateChainPolicy() with

CERT_CHAIN_POLICY_SSL

Quoted 1 line
Quoted 1 line

I'm no Microsoft developer (adn I don't want to be to be honest) but

if

Quoted 1 line
Quoted 1 line

I understand it right, it's better to call CertGetCertificateChain()

as

Quoted 4 lines
Quoted 1 line

I am doing.

You need to use both, one for create the chain and the other to verify that it meets with system CTL for SSL.

Seems that you are right. Below you will find -v4 of the patch that does that.

Also, my previous version didn't actually check for revocations, contrary to what I documented.
I added CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT to the dwFlags of CertGetCertificateChain.

Let me know what you think.

Thanks,
Faidon

#1 lore raw

Hello,

I cleaned it up a little but still things should be done:

1. Add initialize code and load all entry points for this module at one place, single LoadLibrary etc...
2. Add cleanup code to unload all static module resources.
3. Check SSL role by OpenSSL configuration (client or server), see TODO signature.
4. Cleanup warnings.

Available at [1], I did not check it as I don't have active Windows configuration now.
Can you please complete it?

Alon.

[1] http://svn.openvpn.net/projects/openvpn/contrib/alon/BETA21-ms-chk-2/openvpn

Quoted 47 lines · Jason R. Coombs

I'd really like to see this feature in a future build.

Is there anything more that needs to be done to integrate this into 2.1? I can help with code cleanup/refactoring. I don't have a development environment set up, though, so I'd be working blind.

Cheers,
Jason

Quoted 3 lines · On 9/23/07, Faidon Liambotis Wrote: Alon Bar-Lev wrote:
Quoted 2 lines · Faidon Liambotis
Quoted 1 line · Alon Bar-Lev

So you need to use CertVerifyCertificateChainPolicy() with

CERT_CHAIN_POLICY_SSL

Quoted 1 line
Quoted 1 line

I'm no Microsoft developer (adn I don't want to be to be honest) but

if

Quoted 1 line
Quoted 1 line

I understand it right, it's better to call CertGetCertificateChain()

as

Quoted 4 lines
Quoted 1 line

I am doing.

You need to use both, one for create the chain and the other to verify that it meets with system CTL for SSL.

Seems that you are right. Below you will find -v4 of the patch that does that.

Also, my previous version didn't actually check for revocations, contrary to what I documented.
I added CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT to the dwFlags of CertGetCertificateChain.

Let me know what you think.

Thanks,
Faidon

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#2 lore raw

Alon,
I've started working on (1) and (2). Attached is the updated cryptoapi.c. Would you prefer a patch when changes involve a single file? Can you tell me what you think (is this moving in the right direction)? Initially, I've only moved the LoadLibrary code into its own function, but it's still called from the same place. Should I go further and move this initialization code somewhere else? If so, can you suggest where I should look to hook in the initialization?

As for (2), I've created a function that unloads the library and clears out the variables... but it's not called from anywhere. I guess if I know where the initialization will go, then I can find a good place from which to call the cleanup code.

As for (3), where is the SSL role defined? Or, alternatively, what is the procedure when cryptoapi isn't used to verify the certificate is in the correct role?

I hope to contribute further. This is my first time looking at the openvpn source, so please bear with me (or let me know it's not worth your time).

Regards,
Jason

-----Original Message-----
From: Alon Bar-Lev [mailto:[email protected]...]
Sent: Thursday, 25 September, 2008 01:10
To: Jason R. Coombs
Cc: [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

Hello,

I cleaned it up a little but still things should be done:

1. Add initialize code and load all entry points for this module at one place, single LoadLibrary etc...
2. Add cleanup code to unload all static module resources.
3. Check SSL role by OpenSSL configuration (client or server), see TODO signature.
4. Cleanup warnings.

Available at [1], I did not check it as I don't have active Windows configuration now.
Can you please complete it?

Alon.

[1] http://svn.openvpn.net/projects/openvpn/contrib/alon/BETA21-ms-chk-2/openvpn

Quoted 47 lines · Jason R. Coombs

I'd really like to see this feature in a future build.

Is there anything more that needs to be done to integrate this into 2.1? I can help with code cleanup/refactoring. I don't have a development environment set up, though, so I'd be working blind.

Cheers,
Jason

Quoted 3 lines · On 9/23/07, Faidon Liambotis Wrote: Alon Bar-Lev wrote:
Quoted 2 lines · Faidon Liambotis
Quoted 1 line · Alon Bar-Lev

So you need to use CertVerifyCertificateChainPolicy() with

CERT_CHAIN_POLICY_SSL

Quoted 1 line
Quoted 1 line

I'm no Microsoft developer (adn I don't want to be to be honest) but

if

Quoted 1 line
Quoted 1 line

I understand it right, it's better to call CertGetCertificateChain()

as

Quoted 4 lines
Quoted 1 line

I am doing.

You need to use both, one for create the chain and the other to verify that it meets with system CTL for SSL.

Seems that you are right. Below you will find -v4 of the patch that does that.

Also, my previous version didn't actually check for revocations, contrary to what I documented.
I added CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT to the dwFlags of CertGetCertificateChain.

Let me know what you think.

Thanks,
Faidon

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#3 lore raw

Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re:[PATCH v3] Use CryptoAPI CA store)

...

Quoted 4 lines

Alon,
I've started working on (1) and (2). Attached is the
updated cryptoapi.c. Would you prefer a patch when changes involve a single file? Can you tell me what you think (is

...

Quoted 3 lines

As for (3), where is the SSL role defined? Or,
alternatively, what is the procedure when cryptoapi isn't used to verify the certificate is in the correct role?

...

Quoted 1 line

Jason

...

Oh, Happy Day! Now I don't have to do it. I've wanted this for some time, and forgot that someone had already started working on it a year ago.

The ssl server role is controlled by the options --tls-server and --tls-client (these are also set internally by the various 'helper' macros like --client and --server). So, if you have the 'options' object, then the member

    options->tls_server

will indicate if you are in server mode. It is only used in an interesting way in ssl.c, as far as I can see. There is also a --tls-client, but I don't see it being used in an interesting way anyway. (Interesting == something other than setting the value or printing output).

As far as dynamically loading the crypto api dll; the comments state this is a hack to work around MingW's incompleteness? Implying that -- barring incompleteness -- the dll would have otherwise been loaded implicitly? If so then I would suggest loading it on application startup and unloading on shutdown. This is analogous to things like 'WSAStartup' and 'OleInit'. On the other hand, the 'load' function looks idempotent, so it can be called safely as many times as you like. Just make sure to call it before you need it. Also, it is not strictly necessary to call 'unload' unless you are really wanting to truly unload for some technical reason, or just like to be tidy like that. The OS will happily 'unload' it upon process shutdown.

I can't comment on 'code cleanup' because that is subjective.

-Dave

#4 lore raw
In reply to Jason R. Coombs

Hi!

I prefer to receive patches...
Anyway, this is not exactly what I meant.
Please review latest head.
I did not test this, but it should be correct now as far as the changes are concerned.
It may not work as the validation process was never tested.

Alon.

Quoted 90 lines · Jason R. Coombs

Alon,
I've started working on (1) and (2). Attached is the updated cryptoapi.c. Would you prefer a patch when changes involve a single file? Can you tell me what you think (is this moving in the right direction)? Initially, I've only moved the LoadLibrary code into its own function, but it's still called from the same place. Should I go further and move this initialization code somewhere else? If so, can you suggest where I should look to hook in the initialization?

As for (2), I've created a function that unloads the library and clears out the variables... but it's not called from anywhere. I guess if I know where the initialization will go, then I can find a good place from which to call the cleanup code.

As for (3), where is the SSL role defined? Or, alternatively, what is the procedure when cryptoapi isn't used to verify the certificate is in the correct role?

I hope to contribute further. This is my first time looking at the openvpn source, so please bear with me (or let me know it's not worth your time).

Regards,

Jason

-----Original Message-----
From: Alon Bar-Lev [mailto:[email protected]...]
Sent: Thursday, 25 September, 2008 01:10
To: Jason R. Coombs
Cc: [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

Hello,

I cleaned it up a little but still things should be done:

1. Add initialize code and load all entry points for this module at one place, single LoadLibrary etc...
2. Add cleanup code to unload all static module resources.
3. Check SSL role by OpenSSL configuration (client or server), see TODO signature.
4. Cleanup warnings.

Available at [1], I did not check it as I don't have active Windows configuration now.
Can you please complete it?

Alon.

[1] http://svn.openvpn.net/projects/openvpn/contrib/alon/BETA21-ms-chk-2/openvpn

Quoted 47 lines · Jason R. Coombs

I'd really like to see this feature in a future build.

Is there anything more that needs to be done to integrate this into 2.1? I can help with code cleanup/refactoring. I don't have a development environment set up, though, so I'd be working blind.

Cheers,
Jason

Quoted 3 lines · On 9/23/07, Faidon Liambotis Wrote: Alon Bar-Lev wrote:
Quoted 2 lines · Faidon Liambotis
Quoted 1 line · Alon Bar-Lev

So you need to use CertVerifyCertificateChainPolicy() with

CERT_CHAIN_POLICY_SSL

Quoted 1 line
Quoted 1 line

I'm no Microsoft developer (adn I don't want to be to be honest) but

if

Quoted 1 line
Quoted 1 line

I understand it right, it's better to call CertGetCertificateChain()

as

Quoted 4 lines
Quoted 1 line

I am doing.

You need to use both, one for create the chain and the other to verify that it meets with system CTL for SSL.

Seems that you are right. Below you will find -v4 of the patch that does that.

Also, my previous version didn't actually check for revocations, contrary to what I documented.
I added CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT to the dwFlags of CertGetCertificateChain.

Let me know what you think.

Thanks,
Faidon

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#5 lore raw

Any news?

Quoted 105 lines · Alon Bar-Lev

Hi!

I prefer to receive patches...
Anyway, this is not exactly what I meant.
Please review latest head.
I did not test this, but it should be correct now as far as the changes are concerned.
It may not work as the validation process was never tested.

Alon.

Quoted 90 lines · Jason R. Coombs

Alon,
I've started working on (1) and (2). Attached is the updated cryptoapi.c. Would you prefer a patch when changes involve a single file? Can you tell me what you think (is this moving in the right direction)? Initially, I've only moved the LoadLibrary code into its own function, but it's still called from the same place. Should I go further and move this initialization code somewhere else? If so, can you suggest where I should look to hook in the initialization?

As for (2), I've created a function that unloads the library and clears out the variables... but it's not called from anywhere. I guess if I know where the initialization will go, then I can find a good place from which to call the cleanup code.

As for (3), where is the SSL role defined? Or, alternatively, what is the procedure when cryptoapi isn't used to verify the certificate is in the correct role?

I hope to contribute further. This is my first time looking at the openvpn source, so please bear with me (or let me know it's not worth your time).

Regards,

Jason

-----Original Message-----
From: Alon Bar-Lev [mailto:[email protected]...]
Sent: Thursday, 25 September, 2008 01:10
To: Jason R. Coombs
Cc: [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

Hello,

I cleaned it up a little but still things should be done:

1. Add initialize code and load all entry points for this module at one place, single LoadLibrary etc...
2. Add cleanup code to unload all static module resources.
3. Check SSL role by OpenSSL configuration (client or server), see TODO signature.
4. Cleanup warnings.

Available at [1], I did not check it as I don't have active Windows configuration now.
Can you please complete it?

Alon.

[1] http://svn.openvpn.net/projects/openvpn/contrib/alon/BETA21-ms-chk-2/openvpn

Quoted 47 lines · Jason R. Coombs

I'd really like to see this feature in a future build.

Is there anything more that needs to be done to integrate this into 2.1? I can help with code cleanup/refactoring. I don't have a development environment set up, though, so I'd be working blind.

Cheers,
Jason

Quoted 3 lines · On 9/23/07, Faidon Liambotis Wrote: Alon Bar-Lev wrote:
Quoted 2 lines · Faidon Liambotis
Quoted 1 line · Alon Bar-Lev

So you need to use CertVerifyCertificateChainPolicy() with

CERT_CHAIN_POLICY_SSL

Quoted 1 line
Quoted 1 line

I'm no Microsoft developer (adn I don't want to be to be honest) but

if

Quoted 1 line
Quoted 1 line

I understand it right, it's better to call CertGetCertificateChain()

as

Quoted 4 lines
Quoted 1 line

I am doing.

You need to use both, one for create the chain and the other to verify that it meets with system CTL for SSL.

Seems that you are right. Below you will find -v4 of the patch that does that.

Also, my previous version didn't actually check for revocations, contrary to what I documented.
I added CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT to the dwFlags of CertGetCertificateChain.

Let me know what you think.

Thanks,
Faidon

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#6 lore raw

Hi,

Quoted 9 lines · Alon Bar-Lev
Quoted 6 lines · Alon Bar-Lev

I prefer to receive patches...
Anyway, this is not exactly what I meant.
Please review latest head.
I did not test this, but it should be correct now as far as the changes are concerned.
It may not work as the validation process was never tested.

Any news?

Thanks for reviving this. I built it and tried it and seems to work. I didn't test with revoked or expired certificates, however.

As for warnings there's just a trivial one:

	cryptoapi.c:429: warning: passing arg 2 of `d2i_X509' from 	
			 incompatible pointer type

Regards,
Faidon

#7 lore raw
Quoted 7 lines · Faidon Liambotis

Thanks for reviving this. I built it and tried it and seems to work. I didn't test with revoked or expired certificates, however.

As for warnings there's just a trivial one:
cryptoapi.c:429: warning: passing arg 2 of `d2i_X509' from
incompatible pointer type

Thank you!
Can anyone else check it out with revocation/expiration?

Alon.

#8 lore raw
In reply to Faidon Liambotis

Faidon,

If you send me a binary build for Windows 32-bit, I'll test it against expired and revoked certs. I presume I don't need a server configured for this test; it should fail client side before attempting to connect?

Jason

-----Original Message-----
From: Faidon Liambotis [mailto:[email protected]...]
Sent: Tuesday, 07 October, 2008 15:53
To: Alon Bar-Lev
Cc: Jason R. Coombs; [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

Hi,

Quoted 9 lines · Alon Bar-Lev
Quoted 6 lines · Alon Bar-Lev

I prefer to receive patches...
Anyway, this is not exactly what I meant.
Please review latest head.
I did not test this, but it should be correct now as far as the changes are concerned.
It may not work as the validation process was never tested.

Any news?

Thanks for reviving this. I built it and tried it and seems to work. I didn't test with revoked or expired certificates, however.

As for warnings there's just a trivial one:

	cryptoapi.c:429: warning: passing arg 2 of `d2i_X509' from
			 incompatible pointer type

Regards,
Faidon

#9 lore raw

Binaries are at [1].

It is not enough to test it on client, we need to verify that the validation works correctly on both ends, as capi has different policy for servers and clients.

Alon.

[1] http://alon.barlev.googlepages.com/openvpn-mscapi-test-1.tar.bz2

Quoted 53 lines · Jason R. Coombs

Faidon,

If you send me a binary build for Windows 32-bit, I'll test it against expired and revoked certs. I presume I don't need a server configured for this test; it should fail client side before attempting to connect?

Jason

-----Original Message-----
From: Faidon Liambotis [mailto:[email protected]...]
Sent: Tuesday, 07 October, 2008 15:53
To: Alon Bar-Lev
Cc: Jason R. Coombs; [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

Hi,

Quoted 9 lines · Alon Bar-Lev
Quoted 6 lines · Alon Bar-Lev

I prefer to receive patches...
Anyway, this is not exactly what I meant.
Please review latest head.
I did not test this, but it should be correct now as far as the changes are concerned.
It may not work as the validation process was never tested.

Any news?

Thanks for reviving this. I built it and tried it and seems to work. I didn't test with revoked or expired certificates, however.

As for warnings there's just a trivial one:
cryptoapi.c:429: warning: passing arg 2 of `d2i_X509' from
incompatible pointer type

Regards,
Faidon

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#10 lore raw

Alon,
I've tested the client functionality and the basic functionality works great
(not testing against expired or revoked certificates).

I then created a test for expired certs (incorrectly) by specifying an
expired _client_ certificate. Curiously, OpenVPN did not complain about the expired client certificate, but rather proceeded to attempt a connection with it (which subsequently failed to establish TLS I suspect because the server didn't have the corresponding public cert). So I think I may have discovered a limitation of the pre-existing cryptoapicert function.

So to recap:

Cryptoapicert client mode: fails to verify expired cert. Cryptoapica client mode: works!
Cryptoapica client mode expired/revoked cert: untested Cryptoapica server mode: untested

I'm in a conference this week, but will continue to test as time permits.

Jason

-----Original Message-----
From: Alon Bar-Lev [mailto:[email protected]...]
Sent: Tuesday, 07 October, 2008 16:56
To: Jason R. Coombs
Cc: Faidon Liambotis; [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

Binaries are at [1].

It is not enough to test it on client, we need to verify that the validation works correctly on both ends, as capi has different policy for servers and clients.

Alon.

[1] http://alon.barlev.googlepages.com/openvpn-mscapi-test-1.tar.bz2

Quoted 58 lines · Jason R. Coombs

Faidon,

If you send me a binary build for Windows 32-bit, I'll test it against
expired
and revoked certs. I presume I don't need a server configured for this
test;
it should fail client side before attempting to connect?

Jason

-----Original Message-----
From: Faidon Liambotis [mailto:[email protected]...]
Sent: Tuesday, 07 October, 2008 15:53
To: Alon Bar-Lev
Cc: Jason R. Coombs; [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re:
[PATCH
v3] Use CryptoAPI CA store)

Hi,

Quoted 9 lines · Alon Bar-Lev
Quoted 6 lines · Alon Bar-Lev

I prefer to receive patches...
Anyway, this is not exactly what I meant.
Please review latest head.
I did not test this, but it should be correct now as far as the changes are concerned.
It may not work as the validation process was never tested.

Any news?

Thanks for reviving this. I built it and tried it and seems to work. I didn't test with revoked or expired certificates, however.

As for warnings there's just a trivial one:
cryptoapi.c:429: warning: passing arg 2 of `d2i_X509' from
incompatible pointer type

Regards,
Faidon

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#11 lore raw

Please note that the other side should detect the expiration. Hence, if you revoke the client certificate the server should report this and vice versa.
Please also make sure that both sides using the same functionality.

Quoted 104 lines · Jason R. Coombs

Alon,
I've tested the client functionality and the basic functionality works great
(not testing against expired or revoked certificates).

I then created a test for expired certs (incorrectly) by specifying an
expired _client_ certificate. Curiously, OpenVPN did not complain about the expired client certificate, but rather proceeded to attempt a connection with it (which subsequently failed to establish TLS I suspect because the server didn't have the corresponding public cert). So I think I may have discovered a limitation of the pre-existing cryptoapicert function.

So to recap:

Cryptoapicert client mode: fails to verify expired cert. Cryptoapica client mode: works!
Cryptoapica client mode expired/revoked cert: untested Cryptoapica server mode: untested

I'm in a conference this week, but will continue to test as time permits.

Jason

-----Original Message-----
From: Alon Bar-Lev [mailto:[email protected]...]

Sent: Tuesday, 07 October, 2008 16:56
To: Jason R. Coombs

Cc: Faidon Liambotis; [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

Binaries are at [1].

It is not enough to test it on client, we need to verify that the validation works correctly on both ends, as capi has different policy for servers and clients.

Alon.

[1] http://alon.barlev.googlepages.com/openvpn-mscapi-test-1.tar.bz2

Quoted 58 lines · Jason R. Coombs

Faidon,

If you send me a binary build for Windows 32-bit, I'll test it against
expired
and revoked certs. I presume I don't need a server configured for this
test;
it should fail client side before attempting to connect?

Jason

-----Original Message-----
From: Faidon Liambotis [mailto:[email protected]...]
Sent: Tuesday, 07 October, 2008 15:53
To: Alon Bar-Lev
Cc: Jason R. Coombs; [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re:
[PATCH
v3] Use CryptoAPI CA store)

Hi,

Quoted 9 lines · Alon Bar-Lev
Quoted 6 lines · Alon Bar-Lev

I prefer to receive patches...
Anyway, this is not exactly what I meant.
Please review latest head.
I did not test this, but it should be correct now as far as the changes are concerned.
It may not work as the validation process was never tested.

Any news?

Thanks for reviving this. I built it and tried it and seems to work. I didn't test with revoked or expired certificates, however.

As for warnings there's just a trivial one:
cryptoapi.c:429: warning: passing arg 2 of `d2i_X509' from
incompatible pointer type

Regards,
Faidon

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#12 lore raw

New binaries at [1], it should also print the validation status.

[1] http://alon.barlev.googlepages.com/openvpn-mscapi-test-2.tar.bz2

Quoted 112 lines · Alon Bar-Lev

Please note that the other side should detect the expiration.
Hence, if you revoke the client certificate the server should report this and vice versa.
Please also make sure that both sides using the same functionality.

Quoted 104 lines · Jason R. Coombs

Alon,
I've tested the client functionality and the basic functionality works great
(not testing against expired or revoked certificates).

I then created a test for expired certs (incorrectly) by specifying an
expired _client_ certificate. Curiously, OpenVPN did not complain about the expired client certificate, but rather proceeded to attempt a connection with it (which subsequently failed to establish TLS I suspect because the server didn't have the corresponding public cert). So I think I may have discovered a limitation of the pre-existing cryptoapicert function.

So to recap:

Cryptoapicert client mode: fails to verify expired cert. Cryptoapica client mode: works!
Cryptoapica client mode expired/revoked cert: untested Cryptoapica server mode: untested

I'm in a conference this week, but will continue to test as time permits.

Jason

-----Original Message-----
From: Alon Bar-Lev [mailto:[email protected]...]

Sent: Tuesday, 07 October, 2008 16:56
To: Jason R. Coombs

Cc: Faidon Liambotis; [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re: [PATCH v3] Use CryptoAPI CA store)

Binaries are at [1].

It is not enough to test it on client, we need to verify that the validation works correctly on both ends, as capi has different policy for servers and clients.

Alon.

[1] http://alon.barlev.googlepages.com/openvpn-mscapi-test-1.tar.bz2

Quoted 58 lines · Jason R. Coombs

Faidon,

If you send me a binary build for Windows 32-bit, I'll test it against
expired
and revoked certs. I presume I don't need a server configured for this
test;
it should fail client side before attempting to connect?

Jason

-----Original Message-----
From: Faidon Liambotis [mailto:[email protected]...]
Sent: Tuesday, 07 October, 2008 15:53
To: Alon Bar-Lev
Cc: Jason R. Coombs; [email protected]
Subject: Re: [Openvpn-devel] [PATCH v4] Use CryptoAPI CA store (was Re:
[PATCH
v3] Use CryptoAPI CA store)

Hi,

Quoted 9 lines · Alon Bar-Lev
Quoted 6 lines · Alon Bar-Lev

I prefer to receive patches...
Anyway, this is not exactly what I meant.
Please review latest head.
I did not test this, but it should be correct now as far as the changes are concerned.
It may not work as the validation process was never tested.

Any news?

Thanks for reviving this. I built it and tried it and seems to work. I didn't test with revoked or expired certificates, however.

As for warnings there's just a trivial one:
cryptoapi.c:429: warning: passing arg 2 of `d2i_X509' from
incompatible pointer type

Regards,
Faidon

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel