diff options
Diffstat (limited to 'security/keys/key.c')
-rw-r--r-- | security/keys/key.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/security/keys/key.c b/security/keys/key.c index d98c61953be6..46f125aa7fa3 100644 --- a/security/keys/key.c +++ b/security/keys/key.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* Basic authentication token and access key management | 1 | /* Basic authentication token and access key management |
2 | * | 2 | * |
3 | * Copyright (C) 2004-2007 Red Hat, Inc. All Rights Reserved. | 3 | * Copyright (C) 2004-2008 Red Hat, Inc. All Rights Reserved. |
4 | * Written by David Howells (dhowells@redhat.com) | 4 | * Written by David Howells (dhowells@redhat.com) |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
@@ -139,36 +139,6 @@ void key_user_put(struct key_user *user) | |||
139 | 139 | ||
140 | /*****************************************************************************/ | 140 | /*****************************************************************************/ |
141 | /* | 141 | /* |
142 | * insert a key with a fixed serial number | ||
143 | */ | ||
144 | static void __init __key_insert_serial(struct key *key) | ||
145 | { | ||
146 | struct rb_node *parent, **p; | ||
147 | struct key *xkey; | ||
148 | |||
149 | parent = NULL; | ||
150 | p = &key_serial_tree.rb_node; | ||
151 | |||
152 | while (*p) { | ||
153 | parent = *p; | ||
154 | xkey = rb_entry(parent, struct key, serial_node); | ||
155 | |||
156 | if (key->serial < xkey->serial) | ||
157 | p = &(*p)->rb_left; | ||
158 | else if (key->serial > xkey->serial) | ||
159 | p = &(*p)->rb_right; | ||
160 | else | ||
161 | BUG(); | ||
162 | } | ||
163 | |||
164 | /* we've found a suitable hole - arrange for this key to occupy it */ | ||
165 | rb_link_node(&key->serial_node, parent, p); | ||
166 | rb_insert_color(&key->serial_node, &key_serial_tree); | ||
167 | |||
168 | } /* end __key_insert_serial() */ | ||
169 | |||
170 | /*****************************************************************************/ | ||
171 | /* | ||
172 | * assign a key the next unique serial number | 142 | * assign a key the next unique serial number |
173 | * - these are assigned randomly to avoid security issues through covert | 143 | * - these are assigned randomly to avoid security issues through covert |
174 | * channel problems | 144 | * channel problems |
@@ -1020,17 +990,4 @@ void __init key_init(void) | |||
1020 | rb_insert_color(&root_key_user.node, | 990 | rb_insert_color(&root_key_user.node, |
1021 | &key_user_tree); | 991 | &key_user_tree); |
1022 | 992 | ||
1023 | /* record root's user standard keyrings */ | ||
1024 | key_check(&root_user_keyring); | ||
1025 | key_check(&root_session_keyring); | ||
1026 | |||
1027 | __key_insert_serial(&root_user_keyring); | ||
1028 | __key_insert_serial(&root_session_keyring); | ||
1029 | |||
1030 | keyring_publish_name(&root_user_keyring); | ||
1031 | keyring_publish_name(&root_session_keyring); | ||
1032 | |||
1033 | /* link the two root keyrings together */ | ||
1034 | key_link(&root_session_keyring, &root_user_keyring); | ||
1035 | |||
1036 | } /* end key_init() */ | 993 | } /* end key_init() */ |