You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Waite ma...@akuma.org on 2003/01/24 23:58:01 UTC

Issue 650, SSL certificate authority validation questions

I'm trying to tackle issue 650, starting with SSL server certificate 
validation, moving to client certificate authentication. (CRL support 
isn't planned for now, partially because I don't need it and partially 
because neon doesn't support them; I'm also attempting to only use the 
neon-exposed functions for ssl, rather than directly including openssl).

With SSL server certificate validation, I need to know where to find the 
.pem-encoded list of trusted certificate authorities. Here is what I'm 
planning so far:

- a ssl-authorities-file configuration value pointing to a file 
containing a list of certificate authority public certificates.
- a ignore-ssl-invalid-date configuration value for ra_dav, to ignore 
errors dealing with expiry (and also errors dealing with the certificate 
start date being in the future). This should be for both the server 
certificate and CA.
- a ignore-ssl-unknown-ca configuration value for ra_dav, to ignore 
server certificates not signed by one of the CAs listed. This will 
happen everytime if there is no ssl authorities file configed.
- a ignore-ssl-host-mismatch configuration value for ra_dav, to ignore 
the server certificate not matching the requested hostname.

I assume all of these should be in the servers file.  Other than names 
above, there are a couple of issues I'm seeking feedback on:

- should ssl-authorities-file have a default if not specified? If so, 
what should this be across platforms?
- should ignore-ssl-host-mismatch allow you to specify an alternate 
hostname to match against the server certificate CN?
- should there be prompting on the above errors?

-David Waite


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by David Waite ma...@akuma.org.
Branko Čibej wrote:

Win32 already has a ~/.subversion/ dir, but it's called something else. :-)


[Ah, how nice it would be if we could inherit the certificates from the
browser on Windows... and the proxy settings...]

I'm hoping to keep the actual SSL functions abstracted out of 
subversion, and in neon. If someone eventually wants to add support for 
the windows certificate store/cryptoapi and the schannel SSP, their 
changes should be almost all in neon (other than configuration changes 
to not reference or load files.)

-David Waite


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by Branko Čibej br...@xbc.nu.
Justin Erenkrantz wrote:

 --On Friday, January 24, 2003 16:58:01 -0700 David Waite
 mass@akuma.org wrote:

 - should ssl-authorities-file have a default if not specified? If so,
 what should this be across platforms?


 Yes, I think so.  ~/.subversion/certs/ sounds like a reasonable
 starting point (I believe OpenSSL supports pointing at a directory and
 adding all of the .pem's to its internal list).

 Perhaps you could do some registry entries on Win32, but I've seen
 Brane starting to mumble that Win32 should have a ~/.subversion/ dir
 anyway.  I'd defer to whatever the Win32 crowd says... 

Win32 already has a ~/.subversion/ dir, but it's called something else. :-)


[Ah, how nice it would be if we could inherit the certificates from the
browser on Windows... and the proxy settings...]


-- 
Brane Čibej   brane@xbc.nu   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by Karl Fogel kf...@newton.ch.collab.net.
David Waite mass@akuma.org writes:
 I tried to go over HACKING and the logs for some examples, basically
 admitting to myself that I would at least slightly mess up my first
 commit or two. My personal policy for development branches is much
 more informal than the main branch, while with the subversion project
 they appear to be just as formally reviewed. This caused a slight bit
 of internal turmoil. ;-)

Understood -- but a branch in a public repository is not your personal
branch, it's everyone's branch :-).  Not only do people review the
commits, but if it's ever to be merged over to trunk, it needs to
abide by the same standards.

 Points noted. I will probably switch to doxygen-style in case these
 functions someday become part of the public configuration interface.

Sounds good.

Thanks for taking this on!

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by David Waite ma...@akuma.org.
Karl Fogel wrote:

Ben Collins-Sussman sussman@collab.net writes:
  

libsvn_auth is finished, for the moment, as a standalone library.
That is, the internal machinery seems to work, and I've written two
simple (username/password) back-end providers.  I have two test
programs (in tools/examples/auth_provider) that demonstrate how to
write new providers.

My only task (from here out) is to make the existing libsvn_client and
libsvn_ra code actually *use* libsvn_auth.  But that shouldn't affect
your work at all.  I'm not really sure why you'd need a branch.

Mostly because I'm solving issue 650 in multiple steps. First, I'm 
adding server certificate validation in (which is already working - I 
just need to have the returned errors provide more context). Second 
comes client certificate authentication; this will require the new 
libsvn_auth provider. I will hopefully finish the first portion right as 
the simple providers are connected.

The reason it's on a branch is merely that David hasn't been through
the usual commit access process (that is, the patch review process
described in HACKING).  The stuff in trunk is the stuff we
collectively vouch for.  It doesn't matter whether it's live yet or
not -- if it's in the dist, then people will read it as example code,
maybe try to use it, etc.

Since this is a multi-patch, ongoing change, it would be inconvenient
to post patches to the list, though.  Organizing the changes on a
branch is much happier for everyone.

This is actually the sort of thing I would use distributed branching 
for, if it existed ;-)

So please keep committing on the branch; it'll get reviewed there just
as if it were patches to the list.

Speaking of which: you might want look over the logs, the HACKING, and
existing code for guidelines on log messages, doc strings, and
formatting conventions.

I tried to go over HACKING and the logs for some examples, basically 
admitting to myself that I would at least slightly mess up my first 
commit or two. My personal policy for development branches is much more 
informal than the main branch, while with the subversion project they 
appear to be just as formally reviewed. This caused a slight bit of 
internal turmoil. ;-)

For example, this function added in rev 4597:
  

snip

...should give the parameters by name in its doc comment, and align
the asterisks to the right, not the left, in const char *foo (just
as you did one function later, in get_server_setting_int() ).

See the function you removed, get_server_settings(), for an example of
a doc comment.  Note that for public interfaces we've switched to
doxygen-style comments; the upcased-params style is still the norm for
internal static functions, but you could use doxygen there too if you
prefer.  The main thing is to name every parameter and state precisely
what it does.

This will not only make the changes easier to review, but help someone
trying to understand the code two years later :-).

Points noted. I will probably switch to doxygen-style in case these 
functions someday become part of the public configuration interface.

-David Waite


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by Karl Fogel kf...@newton.ch.collab.net.
Ben Collins-Sussman sussman@collab.net writes:
 libsvn_auth is finished, for the moment, as a standalone library.
 That is, the internal machinery seems to work, and I've written two
 simple (username/password) back-end providers.  I have two test
 programs (in tools/examples/auth_provider) that demonstrate how to
 write new providers.
 
 My only task (from here out) is to make the existing libsvn_client and
 libsvn_ra code actually *use* libsvn_auth.  But that shouldn't affect
 your work at all.  I'm not really sure why you'd need a branch.
 
 So by all means, add a new 'certs' credentials type to svn_auth.h, and
 create a new certs_provider.c file in libsvn_auth/.  You can start
 writing the provider now.  

The reason it's on a branch is merely that David hasn't been through
the usual commit access process (that is, the patch review process
described in HACKING).  The stuff in trunk is the stuff we
collectively vouch for.  It doesn't matter whether it's live yet or
not -- if it's in the dist, then people will read it as example code,
maybe try to use it, etc.

Since this is a multi-patch, ongoing change, it would be inconvenient
to post patches to the list, though.  Organizing the changes on a
branch is much happier for everyone.

So please keep committing on the branch; it'll get reviewed there just
as if it were patches to the list.

Speaking of which: you might want look over the logs, the HACKING, and
existing code for guidelines on log messages, doc strings, and
formatting conventions.

For example, this function added in rev 4597:

   /* Retrieve a named configuration value, specifying a default.
      The configuration will first be checked for a configured default
      (in the default group), then will check the specified server
      group for an override. If nothing is found in either the default
      section or the server section, the default value will be returned
   */
   static const char*
   get_server_setting(svn_config_t *cfg,
                      const char* server_group,
                      const char* option_name,
                      const char* default_value)
   {
     const char* retval;
     svn_config_get(cfg, retval, default, option_name, default_value);
     if (server_group)
       {
         svn_config_get(cfg, retval, server_group, option_name, retval);
       }
     return retval;
   }

...should give the parameters by name in its doc comment, and align
the asterisks to the right, not the left, in const char *foo (just
as you did one function later, in get_server_setting_int() ).

See the function you removed, get_server_settings(), for an example of
a doc comment.  Note that for public interfaces we've switched to
doxygen-style comments; the upcased-params style is still the norm for
internal static functions, but you could use doxygen there too if you
prefer.  The main thing is to name every parameter and state precisely
what it does.

This will not only make the changes easier to review, but help someone
trying to understand the code two years later :-).

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by Ben Collins-Sussman su...@collab.net.
David Waite mass@akuma.org writes:

 I would need access to a branch to do that, but other than that its
 fine :-) I will hopefully have the server certificate validation
 portion workable soon, and can post a patch to the list for
 evaluation. For the client certificate authentication work, I am sorta
 blocked on svn_auth, and wouldn't want to create a branch while that
 is still rapidly evolving.

David --

libsvn_auth is finished, for the moment, as a standalone library.
That is, the internal machinery seems to work, and I've written two
simple (username/password) back-end providers.  I have two test
programs (in tools/examples/auth_provider) that demonstrate how to
write new providers.

My only task (from here out) is to make the existing libsvn_client and
libsvn_ra code actually *use* libsvn_auth.  But that shouldn't affect
your work at all.  I'm not really sure why you'd need a branch.

So by all means, add a new 'certs' credentials type to svn_auth.h, and
create a new certs_provider.c file in libsvn_auth/.  You can start
writing the provider now.  

Ryan -- you can also start writing a provider for your svn-agent
daemon.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by Karl Fogel kf...@newton.ch.collab.net.
David Waite mass@akuma.org writes:
 I would need access to a branch to do that, but other than that its
 fine :-) I will hopefully have the server certificate validation
 portion workable soon, and can post a patch to the list for
 evaluation. For the client certificate authentication work, I am sorta
 blocked on svn_auth, and wouldn't want to create a branch while that
 is still rapidly evolving.

You got it :-).  Email me username and plaintext password; we'll set
you up with a branch for this.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by David Waite ma...@akuma.org.

Justin Erenkrantz wrote:

 --On Friday, January 24, 2003 16:58:01 -0700 David Waite 
 mass@akuma.org wrote:

 I assume all of these should be in the servers file.  Other than names
 above, there are a couple of issues I'm seeking feedback on:


 I think the CA options you have listed would be system wide rather 
 than per server.  But, that's me. 

I assume that they will be put into the servers 'default' section, which 
makes them pretty much ra_dav-wide, but allows you to selectively 
override options, especially when it comes to ignoring certificate problems.

 - should ssl-authorities-file have a default if not specified? If so,
 what should this be across platforms?


 Yes, I think so.  ~/.subversion/certs/ sounds like a reasonable 
 starting point (I believe OpenSSL supports pointing at a directory and 
 adding all of the .pem's to its internal list).

 Perhaps you could do some registry entries on Win32, but I've seen 
 Brane starting to mumble that Win32 should have a ~/.subversion/ dir 
 anyway.  I'd defer to whatever the Win32 crowd says... 

I think I will just defer having a default for the time being, then.

 - should ignore-ssl-host-mismatch allow you to specify an alternate
 hostname to match against the server certificate CN?


 I don't think so.  An 'alternate-ssl-host-name' per-server option 
 might be sufficient rather than wrapping it in the 
 ignore-ssl-host-mismatch option.

noted.

 - should there be prompting on the above errors?


 My hunch is no, but it should print out a warning at the very least. 
 Perhaps the host mismatch should at least produce a prompt the first 
 time (thinking of how OpenSSH does this when there is a mismatch).  
 The rest of them aren't as 'fatal.'  (It's out-of-date or the CA is 
 unknown isn't the end of the world and probably is worth a warning if 
 that.) 

 From a security standpoint, they should all be 'fatal' and require 
manual overriding. My install of OpenSSH client will give a failure on 
host mismatch and tell the user to edit the known_hosts file with the 
new cert, or to delete it at their own risk.

Eventually it might be nice to have the OpenSSH client behavior of 
pulling in unknown certificates, but this may be difficult due to the 
heirarchial nature of SSL certificates.

 I would also probably suggest that you do this on a branch rather than 
 doing it in a cave.  But, that's me.  =)  Earlier feedback would be 
 better, I think.  -- justin 

I would need access to a branch to do that, but other than that its fine 
:-) I will hopefully have the server certificate validation portion 
workable soon, and can post a patch to the list for evaluation. For the 
client certificate authentication work, I am sorta blocked on svn_auth, 
and wouldn't want to create a branch while that is still rapidly evolving.

-David Waite


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Issue 650, SSL certificate authority validation questions

Posted by Justin Erenkrantz je...@apache.org.
--On Friday, January 24, 2003 16:58:01 -0700 David Waite mass@akuma.org 
wrote:

 I'm trying to tackle issue 650, starting with SSL server certificate
 validation, moving to client certificate authentication. (CRL support

Cool.  (Ditto on CRLs.  If someone wants 'em, they can add support.)

 I assume all of these should be in the servers file.  Other than names
 above, there are a couple of issues I'm seeking feedback on:

I think the CA options you have listed would be system wide rather than per 
server.  But, that's me.

 - should ssl-authorities-file have a default if not specified? If so,
 what should this be across platforms?

Yes, I think so.  ~/.subversion/certs/ sounds like a reasonable starting 
point (I believe OpenSSL supports pointing at a directory and adding all of 
the .pem's to its internal list).

Perhaps you could do some registry entries on Win32, but I've seen Brane 
starting to mumble that Win32 should have a ~/.subversion/ dir anyway.  I'd 
defer to whatever the Win32 crowd says...

 - should ignore-ssl-host-mismatch allow you to specify an alternate
 hostname to match against the server certificate CN?

I don't think so.  An 'alternate-ssl-host-name' per-server option might be 
sufficient rather than wrapping it in the ignore-ssl-host-mismatch option.

 - should there be prompting on the above errors?

My hunch is no, but it should print out a warning at the very least. 
Perhaps the host mismatch should at least produce a prompt the first time 
(thinking of how OpenSSH does this when there is a mismatch).  The rest of 
them aren't as 'fatal.'  (It's out-of-date or the CA is unknown isn't the 
end of the world and probably is worth a warning if that.)

I would also probably suggest that you do this on a branch rather than 
doing it in a cave.  But, that's me.  =)  Earlier feedback would be better, 
I think.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org