Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cryptography
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
cryptography
Commits
29c1502cc85d
Commit
29c1502cc85d
authored
5 years ago
by
Paul Kehrer
Browse files
Options
Downloads
Patches
Plain Diff
fix indexing on X509 request attribute value (#5312)
parent
687148398131
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/_cffi_src/openssl/x509.py
+1
-0
1 addition, 0 deletions
src/_cffi_src/openssl/x509.py
src/cryptography/hazmat/backends/openssl/x509.py
+6
-2
6 additions, 2 deletions
src/cryptography/hazmat/backends/openssl/x509.py
with
7 additions
and
2 deletions
src/_cffi_src/openssl/x509.py
+
1
−
0
View file @
29c1502c
...
@@ -92,6 +92,7 @@
...
@@ -92,6 +92,7 @@
int X509_REQ_get_attr_by_OBJ(const X509_REQ *, const ASN1_OBJECT *, int);
int X509_REQ_get_attr_by_OBJ(const X509_REQ *, const ASN1_OBJECT *, int);
void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *, int, int, void *);
void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *, int, int, void *);
ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *, int);
ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *, int);
int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *);
int X509_REQ_add1_attr_by_txt(X509_REQ *, const char *, int,
int X509_REQ_add1_attr_by_txt(X509_REQ *, const char *, int,
const unsigned char *, int);
const unsigned char *, int);
...
...
This diff is collapsed.
Click to expand it.
src/cryptography/hazmat/backends/openssl/x509.py
+
6
−
2
View file @
29c1502c
...
@@ -498,7 +498,11 @@
...
@@ -498,7 +498,11 @@
attr
=
self
.
_backend
.
_lib
.
X509_REQ_get_attr
(
self
.
_x509_req
,
pos
)
attr
=
self
.
_backend
.
_lib
.
X509_REQ_get_attr
(
self
.
_x509_req
,
pos
)
self
.
_backend
.
openssl_assert
(
attr
!=
self
.
_backend
.
_ffi
.
NULL
)
self
.
_backend
.
openssl_assert
(
attr
!=
self
.
_backend
.
_ffi
.
NULL
)
asn1_type
=
self
.
_backend
.
_lib
.
X509_ATTRIBUTE_get0_type
(
attr
,
pos
)
# We don't support multiple valued attributes for now.
self
.
_backend
.
openssl_assert
(
self
.
_backend
.
_lib
.
X509_ATTRIBUTE_count
(
attr
)
==
1
)
asn1_type
=
self
.
_backend
.
_lib
.
X509_ATTRIBUTE_get0_type
(
attr
,
0
)
self
.
_backend
.
openssl_assert
(
asn1_type
!=
self
.
_backend
.
_ffi
.
NULL
)
self
.
_backend
.
openssl_assert
(
asn1_type
!=
self
.
_backend
.
_ffi
.
NULL
)
# We need this to ensure that our C type cast is safe.
# We need this to ensure that our C type cast is safe.
# Also this should always be a sane string type, but we'll see if
# Also this should always be a sane string type, but we'll see if
...
@@ -513,7 +517,7 @@
...
@@ -513,7 +517,7 @@
))
))
data
=
self
.
_backend
.
_lib
.
X509_ATTRIBUTE_get0_data
(
data
=
self
.
_backend
.
_lib
.
X509_ATTRIBUTE_get0_data
(
attr
,
pos
,
asn1_type
.
type
,
self
.
_backend
.
_ffi
.
NULL
attr
,
0
,
asn1_type
.
type
,
self
.
_backend
.
_ffi
.
NULL
)
)
self
.
_backend
.
openssl_assert
(
data
!=
self
.
_backend
.
_ffi
.
NULL
)
self
.
_backend
.
openssl_assert
(
data
!=
self
.
_backend
.
_ffi
.
NULL
)
# This cast is safe iff we assert on the type above to ensure
# This cast is safe iff we assert on the type above to ensure
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment