Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
cam
Commits
da1f62a6
Commit
da1f62a6
authored
Sep 27, 2014
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch the digest default to SHA2
parent
537b055e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
cam/ca.py
cam/ca.py
+1
-1
cam/tests/test_ca.py
cam/tests/test_ca.py
+3
-3
No files found.
cam/ca.py
View file @
da1f62a6
...
...
@@ -28,7 +28,7 @@ class CA(object):
self
.
basedir
=
basedir
self
.
config
=
{
'basedir'
:
basedir
,
'default_days'
:
'365'
,
'ou'
:
'CA'
,
'days'
:
'3650'
,
'country'
:
'XX'
,
'crl_url'
:
''
,
'signature_algorithm'
:
'sha
1
'
,
'bits'
:
'2048'
}
'signature_algorithm'
:
'sha
256
'
,
'bits'
:
'2048'
}
self
.
config
.
update
(
config
)
self
.
files
=
_CAFiles
(
basedir
,
conf
=
'conf/ca.conf'
,
...
...
cam/tests/test_ca.py
View file @
da1f62a6
...
...
@@ -53,15 +53,15 @@ class CATest(unittest.TestCase):
self
.
assertTrue
(
os
.
path
.
exists
(
cert
.
public_key_file
))
self
.
assertTrue
(
os
.
path
.
exists
(
cert
.
private_key_file
))
def
test_create_cert_with_
sha2_signatur
e
(
self
):
self
.
ca
.
config
[
'signature_algorithm'
]
=
'
sha256
'
def
test_create_cert_with_
digest_overrid
e
(
self
):
self
.
ca
.
config
[
'signature_algorithm'
]
=
'
md5
'
self
.
ca
.
create
()
cert
=
CertStub
(
'test'
,
'www.test.com'
,
self
.
tmpdir
)
self
.
ca
.
generate
(
cert
)
self
.
assertTrue
(
os
.
path
.
exists
(
cert
.
public_key_file
))
self
.
assertTrue
(
os
.
path
.
exists
(
cert
.
private_key_file
))
self
.
assertTrue
(
'Signature Algorithm:
sha256
WithRSAEncryption'
in
subprocess
.
check_output
(
'Signature Algorithm:
md5
WithRSAEncryption'
in
subprocess
.
check_output
(
[
'openssl'
,
'x509'
,
'-text'
,
'-noout'
,
'-in'
,
cert
.
public_key_file
]))
def
test_revoke
(
self
):
...
...
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