bug 1413336 - (5/7) ensure text files generated by pycert et. al. have trailing newlines r?Cykesiopka
MozReview-Commit-ID: KduWJRzTxBp
--- a/security/manager/ssl/tests/unit/pycert.py
+++ b/security/manager/ssl/tests/unit/pycert.py
@@ -723,17 +723,17 @@ class Certificate(object):
def toPEM(self):
output = '-----BEGIN CERTIFICATE-----'
der = self.toDER()
b64 = base64.b64encode(der)
while b64:
output += '\n' + b64[:64]
b64 = b64[64:]
- output += '\n-----END CERTIFICATE-----'
+ output += '\n-----END CERTIFICATE-----\n'
return output
# The build harness will call this function with an output
# file-like object and a path to a file containing a
# specification. This will read the specification and output
# the certificate as PEM.
# This utility tries as hard as possible to ensure that two
--- a/security/manager/ssl/tests/unit/pycms.py
+++ b/security/manager/ssl/tests/unit/pycms.py
@@ -189,16 +189,16 @@ class CMS(object):
def toPEM(self):
output = '-----BEGIN PKCS7-----'
der = self.toDER()
b64 = base64.b64encode(der)
while b64:
output += '\n' + b64[:64]
b64 = b64[64:]
- output += '\n-----END PKCS7-----'
+ output += '\n-----END PKCS7-----\n'
return output
# When run as a standalone program, this will read a specification from
# stdin and output the certificate as PEM to stdout.
if __name__ == '__main__':
print CMS(sys.stdin).toPEM()
--- a/security/manager/ssl/tests/unit/pykey.py
+++ b/security/manager/ssl/tests/unit/pykey.py
@@ -558,17 +558,17 @@ class RSAKey(object):
def toPEM(self):
output = '-----BEGIN PRIVATE KEY-----'
der = self.toDER()
b64 = base64.b64encode(der)
while b64:
output += '\n' + b64[:64]
b64 = b64[64:]
- output += '\n-----END PRIVATE KEY-----'
+ output += '\n-----END PRIVATE KEY-----\n'
return output
def asSubjectPublicKeyInfo(self):
"""Returns a subject public key info representing
this key for use by pyasn1."""
algorithmIdentifier = rfc2459.AlgorithmIdentifier()
algorithmIdentifier.setComponentByName('algorithm', rfc2459.rsaEncryption)
# Directly setting parameters to univ.Null doesn't currently work.