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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caucase
Commits
bdf0703d
Commit
bdf0703d
authored
Apr 30, 2019
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: ca: Migrate to new registered OID
WIP: Add test covering this migration.
parent
5e8308b4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
caucase/ca.py
caucase/ca.py
+20
-8
caucase/test.py
caucase/test.py
+7
-0
No files found.
caucase/ca.py
View file @
bdf0703d
...
@@ -411,18 +411,30 @@ class CertificateAuthority(object):
...
@@ -411,18 +411,30 @@ class CertificateAuthority(object):
critical
=
False
,
# (no recommendations)
critical
=
False
,
# (no recommendations)
)
)
else
:
else
:
if
auto_signed
==
_AUTO_SIGNED_PASSTHROUGH
:
policy_list
=
[]
# Caller is asking us to let all through, so do this.
for
policy
in
certificate_policies
.
value
:
policy_list
=
certificate_policies
.
value
if
policy
.
policy_identifier
.
dotted_string
.
startswith
(
else
:
utils
.
CAUCASE_LEGACY_OID_TOP
):
# Always migrate CAUCASE_LEGACY_OID_TOP to CAUCASE_OID_TOP
# by copying current policy and replacing its prefix to the new
# OID prefix
identifier_suffix
=
policy
.
policy_identifier
.
dotted_string
[
len
(
utils
.
CAUCASE_LEGACY_OID_TOP
):
]
policy
=
x509
.
PolicyInformation
(
x509
.
oid
.
ObjectIdentifier
(
utils
.
CAUCASE_OID_TOP
+
identifier_suffix
),
policy
.
policy_qualifiers
,
)
policy_list
.
append
(
policy
)
if
auto_signed
!=
_AUTO_SIGNED_PASSTHROUGH
:
# Prevent any caucase extension from being smuggled, especially the
# Prevent any caucase extension from being smuggled, especially the
# "auto-signed" one...
# "auto-signed" one...
policy_list
=
[]
policy_list
=
[]
for
policy
in
certificate_policies
.
value
:
for
policy
in
certificate_policies
.
value
:
startswith
=
policy
.
policy_identifier
.
dotted_string
.
startswith
if
policy
.
policy_identifier
.
dotted_string
.
startswith
(
if
(
utils
.
CAUCASE_OID_TOP
startswith
(
utils
.
CAUCASE_LEGACY_OID_TOP
)
or
# BBB
startswith
(
utils
.
CAUCASE_OID_TOP
)
):
):
continue
continue
policy_list
.
append
(
policy
)
policy_list
.
append
(
policy
)
...
...
caucase/test.py
View file @
bdf0703d
...
@@ -1201,6 +1201,13 @@ class CaucaseTest(unittest.TestCase):
...
@@ -1201,6 +1201,13 @@ class CaucaseTest(unittest.TestCase):
)
)
self
.
assertRaises
(
TypeError
,
self
.
_createFirstUser
)
self
.
assertRaises
(
TypeError
,
self
.
_createFirstUser
)
def
testCRTMigration
(
self
):
"""
Verify that cetificates generated with CAUCASE_LEGACY_OID_TOP are correctly
migrated to CAUCASE_OID_TOP during their renewal
"""
raise
NotImplementedError
def
testCSRFiltering
(
self
):
def
testCSRFiltering
(
self
):
"""
"""
Verify that requester cannot get any extension or extension value they
Verify that requester cannot get any extension or extension value they
...
...
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