]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
use DN from pkcs10 request if it exists
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 7 Feb 2011 22:41:54 +0000 (23:41 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 7 Feb 2011 22:41:54 +0000 (23:41 +0100)
src/pki/commands/issue.c

index 4829413987bc823c9d68ed5b3d1fa63bbe5787f8..6a5686d92a6dc4eb06e9b6c2774f7314304e6636 100644 (file)
@@ -289,11 +289,6 @@ static int issue()
                        goto end;
                }
        }
-       else
-       {
-               id = identification_create_from_encoding(ID_DER_ASN1_DN,
-                                                                               chunk_from_chars(ASN1_SEQUENCE, 0));
-       }
 
        DBG2(DBG_LIB, "Reading ca certificate:");
        ca = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509,
@@ -430,6 +425,12 @@ static int issue()
                goto end;
        }
 
+       if (!id)
+       {
+               id = identification_create_from_encoding(ID_DER_ASN1_DN,
+                                                                               chunk_from_chars(ASN1_SEQUENCE, 0));
+       }
+
        not_before = time(NULL);
        not_after = not_before + lifetime * 24 * 60 * 60;