Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
cam
Commits
85e20677
Commit
85e20677
authored
Dec 10, 2012
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure that the generated CRL is in DER format
parent
ff933c36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
cam/ca.py
cam/ca.py
+9
-2
cam/tests/test_ca.py
cam/tests/test_ca.py
+1
-1
No files found.
cam/ca.py
View file @
85e20677
...
...
@@ -34,7 +34,7 @@ class CA(object):
conf
=
'conf/ca.conf'
,
public_key
=
'public/ca.pem'
,
private_key
=
'private/ca.key'
,
crl
=
'public/c
rl.pem
'
,
crl
=
'public/c
a.crl
'
,
serial
=
'serial'
,
crlnumber
=
'crlnumber'
,
index
=
'index'
)
...
...
@@ -128,10 +128,17 @@ class CA(object):
def
gencrl
(
self
):
log
.
info
(
'generating CRL'
)
# Write the CRL in PEM format to a temporary file.
tmpf
=
self
.
files
.
crl
+
'.tmp'
openssl_wrap
.
run_with_config
(
self
.
basedir
,
self
.
files
.
conf
,
'ca'
,
'-gencrl'
,
'-out'
,
self
.
files
.
crl
,
'ca'
,
'-gencrl'
,
'-out'
,
tmpf
,
'-key'
,
self
.
_getpw
())
# Convert to DER format for distribution.
openssl_wrap
.
run
(
'crl'
,
'-inform'
,
'PEM'
,
'-outform'
,
'DER'
,
'-in'
,
tmpf
,
'-out'
,
self
.
files
.
crl
)
os
.
remove
(
tmpf
)
os
.
chmod
(
self
.
files
.
crl
,
0644
)
def
revoke
(
self
,
cert
):
...
...
cam/tests/test_ca.py
View file @
85e20677
...
...
@@ -54,4 +54,4 @@ class CATest(unittest.TestCase):
cert
=
CertStub
(
'test'
,
'www.test.com'
,
self
.
tmpdir
)
self
.
ca
.
generate
(
cert
)
self
.
ca
.
revoke
(
cert
)
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
tmpdir
,
'public/c
rl.pem
'
)))
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
tmpdir
,
'public/c
a.crl
'
)))
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