commit 87fd5afc8cc13f9de6844146e4fd4e340ca7e9ba
Author: Stanislav Král <stanislav.kral3@gmail.com>
Date:   Wed Mar 31 11:02:15 2021 +0200

    Re #8472 - Changed some parameter names in create_csr method and renamed make_csr_test.py to create_csr_test.py

diff --git a/proj/services/cryptography.py b/proj/services/cryptography.py
index 33ef836..50e93a8 100644
--- a/proj/services/cryptography.py
+++ b/proj/services/cryptography.py
@@ -121,13 +121,13 @@ class CryptographyService:
 
             return self.__run_for_output(args, proc_input=bytes(key, encoding="utf-8")).decode()
 
-    def __create_csr(self, subject, subject_key, subject_key_pass=""):
+    def __create_csr(self, subject, key, key_pass=""):
         """
         Creates a CSR (Certificate Signing Request)
 
         :param subject: an instance of <Subject> representing the subject to be added to the CSR
-        :param subject_key: the private key of the subject to be used to generate the CSR
-        :param subject_key_pass: passphrase of the subject's private key
+        :param key: the private key of the subject to be used to generate the CSR
+        :param key_pass: passphrase of the subject's private key
         :return: string containing the generated certificate signing request in PEM format
         """
 
@@ -137,9 +137,9 @@ class CryptographyService:
 
         # add the passphrase even when None is passed. Otherwise when running tests with pytest some tests freeze
         # waiting for the passphrase to be typed in
-        args.extend(["-passin", f"pass:{subject_key_pass}"])
+        args.extend(["-passin", f"pass:{key_pass}"])
 
-        return self.__run_for_output(args, proc_input=bytes(subject_key, encoding="utf-8")).decode()
+        return self.__run_for_output(args, proc_input=bytes(key, encoding="utf-8")).decode()
 
     def __sign_csr(self, csr, issuer_pem, issuer_key, issuer_key_pass=None, extensions="", days=30):
         """
@@ -193,7 +193,7 @@ class CryptographyService:
         :param days: number of days for which the certificate will be valid
         :return: string containing the generated certificate in PEM format
         """
-        csr = self.__create_csr(subject, subject_key, subject_key_pass=subject_key_pass)
+        csr = self.__create_csr(subject, subject_key, key_pass=subject_key_pass)
         return self.__sign_csr(csr, issuer_pem, issuer_key, issuer_key_pass=issuer_key_pass, extensions=extensions,
                                days=days)
 
diff --git a/proj/tests/services/cryptography/create_csr_test.py b/proj/tests/services/cryptography/create_csr_test.py
new file mode 100644
index 0000000..48c911c
--- /dev/null
+++ b/proj/tests/services/cryptography/create_csr_test.py
@@ -0,0 +1,26 @@
+import subprocess
+
+from proj.model.subject import Subject
+
+
+def get_csr_pem(csr):
+    return subprocess.check_output(["openssl", "req", "-noout", "-text", "-verify", "-in", "-"],
+                                   input=bytes(csr, encoding="utf-8"), stderr=subprocess.STDOUT).decode()
+
+
+def test_make_csr(service):
+    private_key = service.create_private_key()
+
+    subject = Subject(common_name="foo", country="CZ")
+    csr = service._CryptographyService__create_csr(subject, private_key)
+
+    assert "Subject: CN = foo, C = CZ" in get_csr_pem(csr)
+
+
+def test_make_csr_pkey_passphrase(service):
+    private_key = service.create_private_key(passphrase="foobar")
+
+    subject = Subject(common_name="foo", country="CZ", organization_unit="Mysterious Unit")
+    csr = service._CryptographyService__create_csr(subject, private_key, key_pass="foobar")
+
+    assert "Subject: CN = foo, C = CZ, OU = Mysterious Unit" in get_csr_pem(csr)
diff --git a/proj/tests/services/cryptography/make_csr_test.py b/proj/tests/services/cryptography/make_csr_test.py
deleted file mode 100644
index acfaa69..0000000
--- a/proj/tests/services/cryptography/make_csr_test.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import subprocess
-
-from proj.model.subject import Subject
-
-
-def get_csr_pem(csr):
-    return subprocess.check_output(["openssl", "req", "-noout", "-text", "-verify", "-in", "-"],
-                                   input=bytes(csr, encoding="utf-8"), stderr=subprocess.STDOUT).decode()
-
-
-def test_make_csr(service):
-    private_key = service.create_private_key()
-
-    subject = Subject(common_name="foo", country="CZ")
-    csr = service._CryptographyService__create_csr(subject, private_key)
-
-    assert "Subject: CN = foo, C = CZ" in get_csr_pem(csr)
-
-
-def test_make_csr_pkey_passphrase(service):
-    private_key = service.create_private_key(passphrase="foobar")
-
-    subject = Subject(common_name="foo", country="CZ", organization_unit="Mysterious Unit")
-    csr = service._CryptographyService__create_csr(subject, private_key, subject_key_pass="foobar")
-
-    assert "Subject: CN = foo, C = CZ, OU = Mysterious Unit" in get_csr_pem(csr)
