Use a dedicated build part for challenge passwords, BUILD_PASSPHRASE gets obsolete
authorMartin Willi <martin@revosec.ch>
Mon, 19 Jul 2010 11:16:32 +0000 (13:16 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Aug 2010 07:26:21 +0000 (09:26 +0200)
src/libstrongswan/credentials/builder.c
src/libstrongswan/credentials/builder.h
src/libstrongswan/plugins/x509/x509_pkcs10.c
src/pki/commands/req.c
src/scepclient/scepclient.c

index ab7f2b5..c43e5fd 100644 (file)
@@ -45,6 +45,7 @@ ENUM(builder_part_names, BUILD_FROM_FILE, BUILD_END,
        "BUILD_PATHLEN",
        "BUILD_X509_FLAG",
        "BUILD_REVOKED_ENUMERATOR",
+       "BUILD_CHALLENGE_PWD",
        "BUILD_PKCS11_MODULE",
        "BUILD_PKCS11_SLOT",
        "BUILD_PKCS11_KEYID",
index 24d8ce8..996ce83 100644 (file)
@@ -103,6 +103,8 @@ enum builder_part_t {
        BUILD_X509_FLAG,
        /** enumerator_t over (chunk_t serial, time_t date, crl_reason_t reason) */
        BUILD_REVOKED_ENUMERATOR,
+       /** PKCS#10 challenge password */
+       BUILD_CHALLENGE_PWD,
        /** friendly name of a PKCS#11 module, null terminated char* */
        BUILD_PKCS11_MODULE,
        /** slot specifier for a token in a PKCS#11 module, int */
index bfb0ca6..7b48848 100644 (file)
@@ -684,7 +684,7 @@ x509_pkcs10_t *x509_pkcs10_gen(certificate_type_t type, va_list args)
                                enumerator->destroy(enumerator);
                                continue;
                        }
-                       case BUILD_PASSPHRASE:
+                       case BUILD_CHALLENGE_PWD:
                                cert->challengePassword = chunk_clone(va_arg(args, chunk_t));
                                continue;
                        case BUILD_DIGEST_ALG:
index a1ae2f5..d1ca45e 100644 (file)
@@ -127,7 +127,7 @@ static int req()
                                                          BUILD_SIGNING_KEY, private,
                                                          BUILD_SUBJECT, id,
                                                          BUILD_SUBJECT_ALTNAMES, san,
-                                                         BUILD_PASSPHRASE, challenge_password,
+                                                         BUILD_CHALLENGE_PWD, challenge_password,
                                                          BUILD_DIGEST_ALG, digest,
                                                          BUILD_END);
        if (!cert)
index 5c32bbd..b7d029f 100644 (file)
@@ -859,7 +859,7 @@ int main(int argc, char **argv)
                                                BUILD_SIGNING_KEY, private_key,
                                                BUILD_SUBJECT, subject,
                                                BUILD_SUBJECT_ALTNAMES, subjectAltNames,
-                                               BUILD_PASSPHRASE, challengePassword,
+                                               BUILD_CHALLENGE_PWD, challengePassword,
                                                BUILD_DIGEST_ALG, pkcs10_signature_alg,
                                                BUILD_END);
                if (!pkcs10_req)