Convert uses of strdup() to ast_strdup()
[asterisk/asterisk.git] / res / res_crypto.c
index 341723d..73a54ba 100644 (file)
@@ -258,8 +258,7 @@ static struct ast_key *try_load_key (char *dir, char *fname, int ifd, int ofd, i
                        key->ktype &= ~KEY_NEEDS_PASSCODE;
                        if (option_verbose > 2)
                                ast_verbose(VERBOSE_PREFIX_3 "Loaded %s key '%s'\n", key->ktype == AST_KEY_PUBLIC ? "PUBLIC" : "PRIVATE", key->name);
-                       if (option_debug)
-                               ast_log(LOG_DEBUG, "Key '%s' loaded OK\n", key->name);
+                       ast_debug(1, "Key '%s' loaded OK\n", key->name);
                        key->delme = 0;
                } else
                        ast_log(LOG_NOTICE, "Key '%s' is not expected size.\n", key->name);
@@ -436,8 +435,7 @@ static int __ast_check_signature_bin(struct ast_key *key, const char *msg, int m
        res = RSA_verify(NID_sha1, digest, sizeof(digest), (unsigned char *)dsig, 128, key->rsa);
        
        if (!res) {
-               if (option_debug)
-                       ast_log(LOG_DEBUG, "Key failed verification: %s\n", key->name);
+               ast_debug(1, "Key failed verification: %s\n", key->name);
                return -1;
        }
        /* Pass */
@@ -491,8 +489,7 @@ static void crypto_load(int ifd, int ofd)
        while(key) {
                nkey = key->next;
                if (key->delme) {
-                       if (option_debug)
-                               ast_log(LOG_DEBUG, "Deleting key %s type %d\n", key->name, key->ktype);
+                       ast_debug(1, "Deleting key %s type %d\n", key->name, key->ktype);
                        /* Do the delete */
                        if (last)
                                last->next = nkey;