aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-05-11 05:56:56 -0400
committerDavid Howells <dhowells@redhat.com>2012-05-11 05:56:56 -0400
commit1eb1bcf5bfad001128293b86d891c9d6f2f27333 (patch)
treeaf7fce4f0dae5bad37335b0fcf8b2e0d27342a9b
parent9f7ce8e249ab761c7ed753059cb16319ede41762 (diff)
KEYS: Announce key type (un)registration
Announce the (un)registration of a key type in the core key code rather than in the callers. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mimi Zohar <zohar@us.ibm.com>
-rw-r--r--net/dns_resolver/dns_key.c5
-rw-r--r--security/keys/key.c3
2 files changed, 3 insertions, 5 deletions
diff --git a/net/dns_resolver/dns_key.c b/net/dns_resolver/dns_key.c
index c73bba326d70..14b2c3d6e526 100644
--- a/net/dns_resolver/dns_key.c
+++ b/net/dns_resolver/dns_key.c
@@ -249,9 +249,6 @@ static int __init init_dns_resolver(void)
249 struct key *keyring; 249 struct key *keyring;
250 int ret; 250 int ret;
251 251
252 printk(KERN_NOTICE "Registering the %s key type\n",
253 key_type_dns_resolver.name);
254
255 /* create an override credential set with a special thread keyring in 252 /* create an override credential set with a special thread keyring in
256 * which DNS requests are cached 253 * which DNS requests are cached
257 * 254 *
@@ -301,8 +298,6 @@ static void __exit exit_dns_resolver(void)
301 key_revoke(dns_resolver_cache->thread_keyring); 298 key_revoke(dns_resolver_cache->thread_keyring);
302 unregister_key_type(&key_type_dns_resolver); 299 unregister_key_type(&key_type_dns_resolver);
303 put_cred(dns_resolver_cache); 300 put_cred(dns_resolver_cache);
304 printk(KERN_NOTICE "Unregistered %s key type\n",
305 key_type_dns_resolver.name);
306} 301}
307 302
308module_init(init_dns_resolver) 303module_init(init_dns_resolver)
diff --git a/security/keys/key.c b/security/keys/key.c
index 06783cffb3af..dc628941ecd3 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -980,6 +980,8 @@ int register_key_type(struct key_type *ktype)
980 980
981 /* store the type */ 981 /* store the type */
982 list_add(&ktype->link, &key_types_list); 982 list_add(&ktype->link, &key_types_list);
983
984 pr_notice("Key type %s registered\n", ktype->name);
983 ret = 0; 985 ret = 0;
984 986
985out: 987out:
@@ -1002,6 +1004,7 @@ void unregister_key_type(struct key_type *ktype)
1002 list_del_init(&ktype->link); 1004 list_del_init(&ktype->link);
1003 downgrade_write(&key_types_sem); 1005 downgrade_write(&key_types_sem);
1004 key_gc_keytype(ktype); 1006 key_gc_keytype(ktype);
1007 pr_notice("Key type %s unregistered\n", ktype->name);
1005 up_read(&key_types_sem); 1008 up_read(&key_types_sem);
1006} 1009}
1007EXPORT_SYMBOL(unregister_key_type); 1010EXPORT_SYMBOL(unregister_key_type);