Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/basic-python3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# gracefully, make them non-daemonic and use a suitable
# signalling mechanism such as an Event."
- pytest --no-cov -k 'not test_BaseType_Unicode and not test_nestedStructure and not testLockedClass'
# - pytest --no-cov src/DIRAC/Core/Security/test
- pytest --no-cov src/DIRAC/Core/Security/test

steps:
- uses: actions/checkout@v2
Expand Down
10 changes: 7 additions & 3 deletions src/DIRAC/Core/Security/m2crypto/X509Request.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def getPKey(self):

def dumpPKey(self):
"""
Get the pkey as a string
Get the private as a string

:returns: S_OK(PEM encoded PKey)
"""
Expand Down Expand Up @@ -168,6 +168,7 @@ def checkChain(self, chain):

:param chain: :py:class:`X509Chain` object
"""

if not self.__valid:
return S_ERROR(DErrno.ENOCERT)
retVal = chain.getCertInChain()
Expand All @@ -177,8 +178,11 @@ def checkChain(self, chain):
chainPubKey = lastCert.getPublicKey()
if not chainPubKey['OK']:
return chainPubKey
chainPubKey = chainPubKey['Value'].as_pem(cipher=None, callback=M2Crypto.util.no_passphrase_callback)
reqPubKey = self.__reqObj.get_pubkey().as_pem(cipher=None, callback=M2Crypto.util.no_passphrase_callback)

# as_der will dump public key info, while as_pem
# dumps private key.
chainPubKey = chainPubKey['Value'].as_der()
reqPubKey = self.__reqObj.get_pubkey().as_der()
if not chainPubKey == reqPubKey:
return S_ERROR(DErrno.EX509, "Public keys do not match")

Expand Down