]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - security/keys/internal.h
keys: Simplify key description management
[thirdparty/linux.git] / security / keys / internal.h
index 3d5c08db74d2ba28513b13482f8c2520b06512a7..ee71c72fc5f0c5610c64f6fb529df0d812637767 100644 (file)
@@ -90,6 +90,12 @@ extern struct mutex key_construction_mutex;
 extern wait_queue_head_t request_key_conswq;
 
 
+static inline void key_set_index_key(struct keyring_index_key *index_key)
+{
+       size_t n = min_t(size_t, index_key->desc_len, sizeof(index_key->desc));
+       memcpy(index_key->desc, index_key->description, n);
+}
+
 extern struct key_type *key_type_lookup(const char *type);
 extern void key_type_put(struct key_type *ktype);