]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/HOWTO/proxy_certificates.txt
Fix warning in ssl2_enc
[thirdparty/openssl.git] / doc / HOWTO / proxy_certificates.txt
CommitLineData
d18685d9
RL
1<DRAFT!>
2 HOWTO proxy certificates
3
40. WARNING
5
6NONE OF THE CODE PRESENTED HERE HAVE BEEN CHECKED! They are just an
7example to show you how things can be done. There may be typos or
8type conflicts, and you will have to resolve them.
9
101. Introduction
11
12Proxy certificates are defined in RFC 3820. They are really usual
13certificates with the mandatory extension proxyCertInfo.
14
15Proxy certificates are issued by an End Entity (typically a user),
16either directly with the EE certificate as issuing certificate, or by
17extension through an already issued proxy certificate.. They are used
18to extend rights to some other entity (a computer process, typically,
19or sometimes to the user itself), so it can perform operations in the
20name of the owner of the EE certificate.
21
22See http://www.ietf.org/rfc/rfc3820.txt for more information.
23
24
d9bfe4f9
RL
252. A warning about proxy certificates
26
27Noone seems to have tested proxy certificates with security in mind.
28Basically, to this date, it seems that proxy certificates have only
29been used in a world that's highly aware of them. What would happen
30if an unsuspecting application is to validate a chain of certificates
31that contains proxy certificates? It would usually consider the leaf
32to be the certificate to check for authorisation data, and since proxy
33certificates are controlled by the EE certificate owner alone, it's
34would be normal to consider what the EE certificate owner could do
35with them.
36
37subjectAltName and issuerAltName are forbidden in proxy certificates,
38and this is enforced in OpenSSL. The subject must be the same as the
39issuer, with one commonName added on.
40
41Possible threats are, as far as has been imagined so far:
42
43 - impersonation through commonName (think server certificates).
44 - use of additional extensions, possibly non-standard ones used in
45 certain environments, that would grant extra or different
46 authorisation rights.
47
48For this reason, OpenSSL requires that the use of proxy certificates
49be explicitely allowed. Currently, this can be done using the
50following methods:
51
52 - if the application calls X509_verify_cert() itself, it can do the
53 following prior to that call (ctx is the pointer passed in the call
54 to X509_verify_cert()):
55
56 X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS);
57
58 - in all other cases, proxy certificate validation can be enabled
59 before starting the application by setting the envirnoment variable
e0311481 60 OPENSSL_ALLOW_PROXY_CERTS with some non-empty value.
d9bfe4f9
RL
61
62There are thoughts to allow proxy certificates with a line in the
63default openssl.cnf, but that's still in the future.
64
65
663. How to create proxy cerificates
d18685d9
RL
67
68It's quite easy to create proxy certificates, by taking advantage of
69the lack of checks of the 'openssl x509' application (*ahem*). But
70first, you need to create a configuration section that contains a
71definition of the proxyCertInfo extension, a little like this:
72
73 [ v3_proxy ]
74 # A proxy certificate MUST NEVER be a CA certificate.
75 basicConstraints=CA:FALSE
76
77 # Usual authority key ID
78 authorityKeyIdentifier=keyid,issuer:always
79
80 # Now, for the extension that marks this certificate as a proxy one
81 proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:1,policy:text:AB
82
83It's also possible to give the proxy extension in a separate section:
84
85 proxyCertInfo=critical,@proxy_ext
86
87 [ proxy_ext ]
88 language=id-ppl-anyLanguage
89 pathlen=0
90 policy=text:BC
91
92The policy value has a specific syntax, {syntag}:{string}, where the
93syntag determines what will be done with the string. The recognised
94syntags are as follows:
95
96 text indicates that the string is simply the bytes, not
97 encoded in any kind of way:
98
99