Remove pkcs10 module contents

This removes pkcs10 module contents and adds a warning message
about its future removal.

https://pagure.io/freeipa/issue/7131
This commit is contained in:
Stanislav Laznicka
2017-10-25 09:46:41 +02:00
parent f350b5698a
commit 0d7daf0495
14 changed files with 28 additions and 291 deletions
+17
View File
@@ -153,6 +153,23 @@ def isvalid_base64(data):
else:
return True
def strip_csr_header(csr):
"""
Remove the header and footer (and surrounding material) from a CSR.
"""
headerlen = 40
s = csr.find(b"-----BEGIN NEW CERTIFICATE REQUEST-----")
if s == -1:
headerlen = 36
s = csr.find(b"-----BEGIN CERTIFICATE REQUEST-----")
if s >= 0:
e = csr.find(b"-----END")
csr = csr[s + headerlen:e]
return csr
def validate_ipaddr(ipaddr):
"""
Check to see if the given IP address is a valid IPv4 or IPv6 address.