Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
1
Merge Requests
1
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
Boxiang Sun
erp5
Commits
c5ebc91b
Commit
c5ebc91b
authored
Dec 10, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CertificateAuthorityTool: raise ValueError if have duplicate certificate
parent
4ed6c3f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
product/ERP5/Tool/CertificateAuthorityTool.py
product/ERP5/Tool/CertificateAuthorityTool.py
+9
-0
No files found.
product/ERP5/Tool/CertificateAuthorityTool.py
View file @
c5ebc91b
...
@@ -188,6 +188,15 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -188,6 +188,15 @@ class CertificateAuthorityTool(BaseTool):
raise
ValueError
(
"Invalid common name: %r"
%
common_name
)
raise
ValueError
(
"Invalid common name: %r"
%
common_name
)
self
.
_checkCertificateAuthority
()
self
.
_checkCertificateAuthority
()
self
.
_lockCertificateAuthority
()
self
.
_lockCertificateAuthority
()
index
=
open
(
self
.
index
).
read
().
splitlines
()
valid_line_list
=
[
q
for
q
in
index
if
q
.
startswith
(
'V'
)
and
(
'CN=%s/'
%
common_name
in
q
)]
if
len
(
valid_line_list
)
>=
1
:
self
.
_unlockCertificateAuthority
()
raise
ValueError
(
'The common name %r already has a certificate'
'please revoke it before request a new one..'
%
common_name
)
try
:
try
:
new_id
=
open
(
self
.
serial
,
'r'
).
read
().
strip
().
lower
()
new_id
=
open
(
self
.
serial
,
'r'
).
read
().
strip
().
lower
()
key
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'private'
,
key
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'private'
,
...
...
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