used rsa coeff field in OpenPGP secret key payload
[strongswan.git] / src / libstrongswan / plugins / pubkey / pubkey_public_key.c
index 0bb3d71..6d3ae66 100644 (file)
@@ -13,8 +13,6 @@
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  * for more details.
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  * for more details.
- *
- * $Id$
  */
 
 #include "pubkey_public_key.h"
  */
 
 #include "pubkey_public_key.h"
@@ -39,9 +37,10 @@ static const asn1Object_t pkinfoObjects[] = {
 
 
 /**
 
 
 /**
- * Load a public key from an ASN1 encoded blob
+ * Load a public key from an ASN.1 encoded blob
+ * Also used by pubkey_cert.c
  */
  */
-static public_key_t *load(chunk_t blob)
+public_key_t *pubkey_public_key_load(chunk_t blob)
 {
        asn1_parser_t *parser;
        chunk_t object;
 {
        asn1_parser_t *parser;
        chunk_t object;
@@ -134,7 +133,7 @@ static void add(private_builder_t *this, builder_part_t part, ...)
                        {
                                va_start(args, part);
                                blob = va_arg(args, chunk_t);
                        {
                                va_start(args, part);
                                blob = va_arg(args, chunk_t);
-                               this->key = load(chunk_clone(blob));
+                               this->key = pubkey_public_key_load(chunk_clone(blob));
                                va_end(args);
                                return;
                        }
                                va_end(args);
                                return;
                        }
@@ -146,9 +145,9 @@ static void add(private_builder_t *this, builder_part_t part, ...)
                                va_start(args, part);
                                pem = va_arg(args, char *);
                                blob = chunk_clone(chunk_create(pem, strlen(pem)));
                                va_start(args, part);
                                pem = va_arg(args, char *);
                                blob = chunk_clone(chunk_create(pem, strlen(pem)));
-                               if (pem_to_bin(&blob, &chunk_empty, &pgp))
+                               if (pem_to_bin(&blob, chunk_empty, &pgp) == SUCCESS)
                                {
                                {
-                                       this->key = load(chunk_clone(blob));
+                                       this->key = pubkey_public_key_load(chunk_clone(blob));
                                }
                                free(blob.ptr);
                                va_end(args);
                                }
                                free(blob.ptr);
                                va_end(args);