]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Log messages for PKCS1 and PEM parsing in ASN log group.
authorTobias Brunner <tobias@strongswan.org>
Fri, 16 Dec 2011 15:32:47 +0000 (16:32 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 16 Dec 2011 15:44:38 +0000 (16:44 +0100)
src/libstrongswan/plugins/pem/pem_builder.c
src/libstrongswan/plugins/pkcs1/pkcs1_builder.c

index b760adda9c840c774168db4d92382883ae5d053b..f05d348eed6498a392fa6912949e2eb984aa70e5 100644 (file)
@@ -73,7 +73,7 @@ static bool find_boundary(char* tag, chunk_t *line)
        {
                if (present("-----", line))
                {
-                       DBG2(DBG_LIB, "  -----%s %.*s-----", tag, (int)name.len, name.ptr);
+                       DBG2(DBG_ASN, "  -----%s %.*s-----", tag, (int)name.len, name.ptr);
                        return TRUE;
                }
                line->ptr++;  line->len--;  name.len++;
@@ -99,7 +99,7 @@ static status_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg,
        hasher = lib->crypto->create_hasher(lib->crypto, HASH_MD5);
        if (hasher == NULL)
        {
-               DBG1(DBG_LIB, "  MD5 hash algorithm not available");
+               DBG1(DBG_ASN, "  MD5 hash algorithm not available");
                return NOT_SUPPORTED;
        }
        hash.len = hasher->get_hash_size(hasher);
@@ -121,7 +121,7 @@ static status_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg,
        crypter = lib->crypto->create_crypter(lib->crypto, alg, key_size);
        if (crypter == NULL)
        {
-               DBG1(DBG_LIB, "  %N encryption algorithm not available",
+               DBG1(DBG_ASN, "  %N encryption algorithm not available",
                         encryption_algorithm_names, alg);
                return NOT_SUPPORTED;
        }
@@ -131,7 +131,7 @@ static status_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg,
                blob->len % crypter->get_block_size(crypter))
        {
                crypter->destroy(crypter);
-               DBG1(DBG_LIB, "  data size is not multiple of block size");
+               DBG1(DBG_ASN, "  data size is not multiple of block size");
                return PARSE_ERROR;
        }
        crypter->decrypt(crypter, *blob, iv, &decrypted);
@@ -155,7 +155,7 @@ static status_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg,
        {
                if (*last_padding_pos != padding)
                {
-                       DBG1(DBG_LIB, "  invalid passphrase");
+                       DBG1(DBG_ASN, "  invalid passphrase");
                        return INVALID_ARG;
                }
        }
@@ -234,7 +234,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
                                }
 
                                /* we are looking for a parameter: value pair */
-                               DBG2(DBG_LIB, "  %.*s", (int)line.len, line.ptr);
+                               DBG2(DBG_ASN, "  %.*s", (int)line.len, line.ptr);
                                ugh = extract_parameter_value(&name, &value, &line);
                                if (ugh != NULL)
                                {
@@ -274,7 +274,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
                                        }
                                        else
                                        {
-                                               DBG1(DBG_LIB, "  encryption algorithm '%.*s'"
+                                               DBG1(DBG_ASN, "  encryption algorithm '%.*s'"
                                                         " not supported", dek.len, dek.ptr);
                                                return NOT_SUPPORTED;
                                        }
@@ -298,7 +298,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
                                        *pgp = TRUE;
                                        data.ptr++;
                                        data.len--;
-                                       DBG2(DBG_LIB, "  armor checksum: %.*s", (int)data.len,
+                                       DBG2(DBG_ASN, "  armor checksum: %.*s", (int)data.len,
                                                 data.ptr);
                                        continue;
                                }
index a605fabc7027bc76bca081455af1e0baf902acc0..6d022f36274ad6bf11a96299d0ca9218bc2f4ec8 100644 (file)
@@ -81,10 +81,10 @@ static public_key_t *parse_public_key(chunk_t blob)
                                        /* skip initial bit string octet defining 0 unused bits */
                                        object = chunk_skip(object, 1);
                                }
-                               DBG2(DBG_LIB, "-- > --");
+                               DBG2(DBG_ASN, "-- > --");
                                key = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, type,
                                                                                 BUILD_BLOB_ASN1_DER, object, BUILD_END);
-                               DBG2(DBG_LIB, "-- < --");
+                               DBG2(DBG_ASN, "-- < --");
                                break;
                }
        }
@@ -197,7 +197,7 @@ static private_key_t *parse_rsa_private_key(chunk_t blob)
                        case PRIV_KEY_VERSION:
                                if (object.len > 0 && *object.ptr != 0)
                                {
-                                       DBG1(DBG_LIB, "PKCS#1 private key format is not version 1");
+                                       DBG1(DBG_ASN, "PKCS#1 private key format is not version 1");
                                        goto end;
                                }
                                break;