]> git.ipfire.org Git - thirdparty/strongswan.git/blobdiff - src/libstrongswan/plugins/pem/pem_encoder.c
Spelling fixes
[thirdparty/strongswan.git] / src / libstrongswan / plugins / pem / pem_encoder.c
index 35ea3e885992cc96aacaa6ed24b2a4cbf9d1e22e..ba322479782bd90a413f027746191af56b6f59f0 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2010 Andreas Steffen
- * Hochschule fuer Technik Rapperswil
+ * Copyright (C) 2010-2016 Andreas Steffen
+ * HSR Hochschule fuer Technik Rapperswil
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -15,6 +15,8 @@
 
 #include "pem_encoder.h"
 
+#include <library.h>
+
 #define BYTES_PER_LINE 48
 
 /**
@@ -37,7 +39,11 @@ bool pem_encoder_encode(cred_encoding_type_t type, chunk_t *encoding,
                        if (cred_encoding_args(args, CRED_PART_RSA_PUB_ASN1_DER,
                                                                        &asn1, CRED_PART_END) ||
                                cred_encoding_args(args, CRED_PART_ECDSA_PUB_ASN1_DER,
-                                                                       &asn1, CRED_PART_END))
+                                                                       &asn1, CRED_PART_END) ||
+                               cred_encoding_args(args, CRED_PART_EDDSA_PUB_ASN1_DER,
+                                                                       &asn1, CRED_PART_END) ||
+                               cred_encoding_args(args, CRED_PART_BLISS_PUB_ASN1_DER,
+                                                                  &asn1, CRED_PART_END))
                        {
                                break;
                        }
@@ -53,11 +59,6 @@ bool pem_encoder_encode(cred_encoding_type_t type, chunk_t *encoding,
                                        break;
                                }
                        }
-                       if (cred_encoding_args(args, CRED_PART_BLISS_PUB_ASN1_DER,
-                                                                  &asn1, CRED_PART_END))
-                       {
-                               break;
-                       }
                        return FALSE;
                case PRIVKEY_PEM:
                        label ="RSA PRIVATE KEY";
@@ -97,6 +98,12 @@ bool pem_encoder_encode(cred_encoding_type_t type, chunk_t *encoding,
                                label ="BLISS PRIVATE KEY";
                                break;
                        }
+                       if (cred_encoding_args(args, CRED_PART_EDDSA_PRIV_ASN1_DER,
+                                                                  &asn1, CRED_PART_END))
+                       {
+                               label ="PRIVATE KEY";
+                               break;
+                       }
                        return FALSE;
                case CERT_PEM:
                        if (cred_encoding_args(args, CRED_PART_X509_ASN1_DER,
@@ -113,7 +120,7 @@ bool pem_encoder_encode(cred_encoding_type_t type, chunk_t *encoding,
                        }
                        if (cred_encoding_args(args, CRED_PART_PKCS10_ASN1_DER,
                                                                   &asn1, CRED_PART_END))
-                       {       /* PEM encode PKCS10 certificate reqeuest */
+                       {       /* PEM encode PKCS10 certificate request */
                                label = "CERTIFICATE REQUEST";
                                break;
                        }