Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caucase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
caucase
Commits
59e7da94
Commit
59e7da94
authored
Jul 14, 2018
by
Vincent Pelletier
Committed by
Vincent Pelletier
Jul 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: Do not use chained add_extension syntax on a single statement.
For consistency with other places in caucase.
parent
f15d0bad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
24 deletions
+27
-24
caucase/ca.py
caucase/ca.py
+1
-1
caucase/http.py
caucase/http.py
+26
-23
No files found.
caucase/ca.py
View file @
59e7da94
...
@@ -37,7 +37,7 @@ from .exceptions import (
...
@@ -37,7 +37,7 @@ from .exceptions import (
NotACertificateSigningRequest
,
NotACertificateSigningRequest
,
)
)
__all__
=
(
'CertificateAuthority'
,
'UserCertificateAuthority'
)
__all__
=
(
'CertificateAuthority'
,
'UserCertificateAuthority'
,
'Extension'
)
_cryptography_backend
=
default_backend
()
_cryptography_backend
=
default_backend
()
_AUTO_SIGNED_NO
=
0
_AUTO_SIGNED_NO
=
0
...
...
caucase/http.py
View file @
59e7da94
...
@@ -41,7 +41,7 @@ import pem
...
@@ -41,7 +41,7 @@ import pem
from
.
import
exceptions
from
.
import
exceptions
from
.
import
utils
from
.
import
utils
from
.wsgi
import
Application
from
.wsgi
import
Application
from
.ca
import
CertificateAuthority
,
UserCertificateAuthority
from
.ca
import
CertificateAuthority
,
UserCertificateAuthority
,
Extension
from
.storage
import
SQLite3Storage
from
.storage
import
SQLite3Storage
from
.http_wsgirequesthandler
import
WSGIRequestHandler
from
.http_wsgirequesthandler
import
WSGIRequestHandler
...
@@ -226,33 +226,36 @@ def getSSLContext(
...
@@ -226,33 +226,36 @@ def getSSLContext(
csr_id
=
cas
.
appendCertificateSigningRequest
(
csr_id
=
cas
.
appendCertificateSigningRequest
(
csr_pem
=
utils
.
dump_certificate_request
(
csr_pem
=
utils
.
dump_certificate_request
(
x509
.
CertificateSigningRequestBuilder
(
x509
.
CertificateSigningRequestBuilder
(
).
subject_name
(
subject_name
=
x509
.
Name
([
x509
.
Name
([
x509
.
NameAttribute
(
x509
.
NameAttribute
(
oid
=
x509
.
oid
.
NameOID
.
COMMON_NAME
,
oid
=
x509
.
oid
.
NameOID
.
COMMON_NAME
,
value
=
hostname
.
decode
(
'ascii'
),
value
=
hostname
.
decode
(
'ascii'
),
),
),
]),
]),
).
add_extension
(
extensions
=
[
x509
.
KeyUsage
(
Extension
(
# pylint: disable=bad-whitespace
x509
.
KeyUsage
(
digital_signature
=
True
,
# pylint: disable=bad-whitespace
content_commitment
=
False
,
digital_signature
=
True
,
key_encipherment
=
True
,
content_commitment
=
False
,
data_encipherment
=
False
,
key_encipherment
=
True
,
key_agreement
=
False
,
data_encipherment
=
False
,
key_cert_sign
=
False
,
key_agreement
=
False
,
crl_sign
=
False
,
key_cert_sign
=
False
,
encipher_only
=
False
,
crl_sign
=
False
,
decipher_only
=
False
,
encipher_only
=
False
,
# pylint: enable=bad-whitespace
decipher_only
=
False
,
),
# pylint: enable=bad-whitespace
critical
=
True
,
),
).
add_extension
(
critical
=
True
,
x509
.
SubjectAlternativeName
([
),
x509
.
DNSName
(
hostname
.
decode
(
'ascii'
)),
Extension
(
]),
x509
.
SubjectAlternativeName
([
critical
=
True
,
x509
.
DNSName
(
hostname
.
decode
(
'ascii'
)),
]),
critical
=
True
,
),
],
).
sign
(
).
sign
(
private_key
=
new_key
,
private_key
=
new_key
,
algorithm
=
utils
.
DEFAULT_DIGEST_CLASS
(),
algorithm
=
utils
.
DEFAULT_DIGEST_CLASS
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment