You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -65,13 +65,13 @@ Although [RFC-8226 section 9](https://www.rfc-editor.org/rfc/rfc8226#section-9)
65
65
shall contain a single SPC value.". Asterisk therefore will fail to verify a certificate whose TNAuthList extension contains something other than an SPC code.
66
66
67
67
It was apparently envisioned that a facility would be made available to verify that a particular SPC has the authority over a particular telephone number. To our knowledge, that facility doesn't yet exist. This means that there is currently no way for Asterisk to verify that the SPC in the certificate has the authority over the TN in the Identity header.
68
-
69
68
///
69
+
70
70
## Asterisk Implementation
71
71
72
72
### Configuration
73
73
74
-
All configuration is done via the stir_shaken.conf file. The sample [stir_shaken.conf](stir_shaken.conf) is heavily commented.
74
+
All configuration is done via the stir_shaken.conf file. The sample [stir_shaken.conf](https://github.com/asterisk/asterisk/raw/master/configs/samples/stir_shaken.conf.sample) is heavily commented.
75
75
76
76
There are 4 object types used by the STIR/SHAKEN process...
77
77
@@ -279,38 +279,84 @@ CA certififcate to you separately.
279
279
Default: no
280
280
281
281
##### ca_file
282
-
Path to a single file containing a CA certificate or certificate chain
283
-
to be used to validate the certificates in incoming requests.
282
+
Path to a file containing one or more CA certs in PEM format.
283
+
These certs are used to verify the chain of trust for the
284
+
certificate retrieved from the X5U Identity header parameter. This
285
+
file must have the root CA certificate, the certificate of the
286
+
issuer of the X5U certificate, and any intermediate certificates
287
+
between them.
284
288
285
289
Default: none
290
+
See Also: [Certificate and CRL Notes](#certificate-and-crl-notes) below
286
291
287
292
##### ca_path
288
-
Path to a directory containing one or more CA certificates to be used
289
-
to validate the certificates in incoming requests. The files in that
290
-
directory must contain only one certificate each and the directory
291
-
must be hashed using the OpenSSL 'c_rehash' utility.
293
+
Path to a directory containing one or more hashed CA certs.
294
+
See ca_file above.
295
+
For this option, each certificate must be placed in its own
296
+
PEM file in the directory specified and hashed with the
297
+
following command:
298
+
`openssl rehash <ca_path>`
292
299
293
-
Default: none
300
+
Default: none
301
+
See Also: [Certificate and CRL Notes](#certificate-and-crl-notes) below
294
302
295
303
NOTE: Both ca_file and ca_path can be specified but at least one
296
304
MUST be.
297
305
298
306
##### crl_file
299
-
Path to a single file containing a CA certificate revocation list
300
-
to be used to validate the certificates in incoming requests.
307
+
Path to a file containing one or more CRLs in PEM format.
308
+
If you with to check if the certificate in the X5U Identity header
309
+
parameter has been revoked, you'll need the certificate revocation
310
+
list generated by the issuer. NOTE: CRLs are sometimes distributed
311
+
in DER format instead of PEM format. You can covert a DER file to
312
+
PEM with the folowing command:
313
+
`openssl crl -inform DER -in crl.der -outform PEM -out crl.pem`
301
314
302
-
Default: none
315
+
Default: none
316
+
See Also: [Certificate and CRL Notes](#certificate-and-crl-notes) below
303
317
304
318
##### crl_path
305
-
Path to a directory containing one or more CA certificate revocation
306
-
lists to be used to validate the certificates in incoming requests.
307
-
The files in that directory must contain only one certificate each and
308
-
the directory must be hashed using the OpenSSL 'c_rehash' utility.
319
+
Path to a directory containing one or more hashed CRLs.
320
+
See crl_file above.
321
+
For this option, each CRL must be placed in its own
322
+
PEM file in the directory specified and hashed with the
323
+
following command:
324
+
`openssl rehash <crl_path>`
309
325
310
-
Default: none
326
+
Default: none
327
+
See Also: [Certificate and CRL Notes](#certificate-and-crl-notes) below
311
328
312
329
NOTE: Neither crl_file nor crl_path are required.
313
330
331
+
##### untrusted_cert_file
332
+
Path to a file containing one or more untrusted certs in PEM format.
333
+
Unfortunately, sometimes the CRLs are signed by a different CA
334
+
than the certificate being verified. In this case, you'll need to
335
+
provide the certificate belonging to the issuer of the CRL. That
336
+
certificate is considered "untrusted" by OpenSSL and can't be placed
337
+
in the ca_file or ca_path. It has to be specified here.
338
+
339
+
Default: none
340
+
See Also: [Certificate and CRL Notes](#certificate-and-crl-notes) below.
341
+
Added in Asterisk releases 18.25.0, 20.10.0, 21.5.0, certified-20.7-cert2
342
+
343
+
##### untrusted_cert_path
344
+
Path to a directory containing one or more hashed untrusted certs used
345
+
to verify CRLs.
346
+
See untrusted_cert_file above.
347
+
For this option, each certificates must be placed in its own
348
+
PEM file in the directory specified and hashed with the
349
+
following command:
350
+
`openssl rehash <ca_path>`
351
+
352
+
Default: none
353
+
See Also: [Certificate and CRL Notes](#certificate-and-crl-notes) below.
354
+
Added in Asterisk releases 18.25.0, 20.10.0, 21.5.0, certified-20.7-cert2
355
+
356
+
NOTE: Neither untrusted_cert_file nor untrusted_cert_path are required
357
+
unless you're verifying CRLs that aren't signed by the same CA as the
358
+
X5U certificate.
359
+
314
360
##### cert_cache_dir
315
361
Incoming Identity headers will have a URL pointing to the certificate
316
362
used to sign the header. To prevent us from having to retrieve the
@@ -575,6 +621,140 @@ Compared to verification, attestation is simple.
575
621
1. If there's no "tn" object matching the caller-id, skip attestation and continue the call. With the 18.23.0, 20.8.0 and 21.3.0 releases of Asterisk, the caller-id is canonicalized (everything except 0-9, # and * are removed) before a "tn" object is searched for. Previously, the caller-id had to match the "tn" id exactly so a caller-id of "+1234567890" would NOT match a "tn" id of "1234567890".
576
622
1. Finally create and sign the Identity header using the `private_key_file`, `public_cert_url`, `attest_level` and `send_mky` parameters from [tn](#tn-object), [profile](#profile-object) or [attestation](#attestation-object). If this fails, the call will be terminated.
577
623
624
+
## Certificate and CRL Notes
625
+
626
+
Verifying the certificate retrieved by following the link in the received
627
+
X5U Identity header parameter can be a tricky business. At a mimimum, you'll
628
+
need the certificate of the X5U certificate's issuer. If the X5U certificate
629
+
was signed by an intermediate certificate authority, you'll need that certificate
630
+
plus any others up the chain to the issuer's root certificate authority.
631
+
If you plan on verifying whether the X5U certificate has been revoked or not,
632
+
you'll need the issuer's certificate revokation list and if the CRL was not
633
+
signed by the same CA chain as the X5U certificate, you'll need the chain
634
+
for the CRL as well.
635
+
636
+
If the X5U certificate was produced by an entity that knows how to
637
+
properly set up and operate a PKI infrastructure, there are some easy
638
+
steps you can take to find those certificates yourself. If not, you
639
+
are unfortunately at their mercy to provide you with the proper files.
640
+
anyway...
641
+
642
+
A properly constructed X5U certificate will have two X509 extensions
643
+
that can help you get the issuer's certificate and, optionally, a CRL.
644
+
If you have the URI in the X5U Identity header parameter, you can use
The CRL itself will need to be supplied in either [verification - crl_file](#crl_file) or [verification - crl_path](#crl_path). Be aware though, some CRLs are
704
+
distributed in DER format instead of PEM format. You can check which format
705
+
was retrieved by running `file <crl_file>`. If the result is `ASCII text`, it's
706
+
already PEM format. If the result is `data`, it's DER format. Since asterisk can only
707
+
accept PEM format files, you'll need to convert the DER CRL into PEM format
708
+
with the following command:
709
+
710
+
```
711
+
openssl crl -inform DER -in somecompany.crl -outform PEM -out somecompany-crl.pem
712
+
```
713
+
714
+
You can test that you have all the files needed for a successful verification
715
+
by performing the following...
716
+
717
+
Concatenate all the CA certificates downloaded into a single file.
0 commit comments