#define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */ #define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */ #define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */ #define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */ #define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */ #define KEY_POS_SETATTR 0x20000000 /* possessor can set key attributes */ #define KEY_POS_ALL 0x3f000000
struct key_tag { struct rcu_head rcu;
refcount_t usage; bool removed; /* T when subject removed */
};
struct keyring_index_key { /* [!] If this structure is altered, the union in struct key must change too! */ unsignedlong hash; /* Hash value */ union { struct { #ifdef __LITTLE_ENDIAN /* Put desc_len at the LSB of x */
u16 desc_len; char desc[sizeof(long) - 2]; /* First few chars of description */ #else char desc[sizeof(long) - 2]; /* First few chars of description */
u16 desc_len; #endif
}; unsignedlong x;
}; struct key_type *type; struct key_tag *domain_tag; /* Domain of operation */ constchar *description;
};
union key_payload { void __rcu *rcu_data0; void *data[4];
};
/*****************************************************************************/ /* *authenticationtoken/accesscredential/keyring *-typesofkeyinclude: *-keyrings *-diskencryptionIDs *-KerberosTGTsandtickets
*/ struct key {
refcount_t usage; /* number of references */
key_serial_t serial; /* key serial number */ union { struct list_head graveyard_link; struct rb_node serial_node;
}; #ifdef CONFIG_KEY_NOTIFICATIONS struct watch_list *watchers; /* Entities watching this key for changes */ #endif struct rw_semaphore sem; /* change vs change sem */ struct key_user *user; /* owner of this key */ void *security; /* security data for this key */ union {
time64_t expiry; /* time at which key expires (or 0) */
time64_t revoked_at; /* time at which key was revoked */
};
time64_t last_used_at; /* last time used for LRU keyring discard */
kuid_t uid;
kgid_t gid;
key_perm_t perm; /* access permissions */ unsignedshort quotalen; /* length added to quota */ unsignedshort datalen; /* payload data length *-maynotmatchRCUdereferencedpayload *-payloadshouldcontainownlength
*/ short state; /* Key state (+) or rejection error (-) */
unsignedlong flags; /* status flags (change with bitops) */ #define KEY_FLAG_DEAD 0/* set if key type has been deleted */ #define KEY_FLAG_REVOKED 1/* set if key had been revoked */ #define KEY_FLAG_IN_QUOTA 2/* set if key consumes quota */ #define KEY_FLAG_USER_CONSTRUCT 3/* set if key is being constructed in userspace */ #define KEY_FLAG_ROOT_CAN_CLEAR 4/* set if key can be cleared by root without permission */ #define KEY_FLAG_INVALIDATED 5/* set if key has been invalidated */ #define KEY_FLAG_BUILTIN 6/* set if key is built in to the kernel */ #define KEY_FLAG_ROOT_CAN_INVAL 7/* set if key can be invalidated by root without permission */ #define KEY_FLAG_KEEP 8/* set if key should not be removed */ #define KEY_FLAG_UID_KEYRING 9/* set if key is a user or user session keyring */ #define KEY_FLAG_USER_ALIVE 10/* set if final put has not happened on key yet */
/* the key type and key description string *-thedescisusedtomatchakeyagainstsearchcriteria *-itshouldbeaprintablestring *-eg:forkrb5AFS,thismightbe"afs@REDHAT.COM"
*/ union { struct keyring_index_key index_key; struct { unsignedlong hash; unsignedlong len_desc; struct key_type *type; /* type of key */ struct key_tag *domain_tag; /* Domain of operation */ char *description;
};
};
/* key data *-thisisusedtoholdthedataactuallyusedincryptographyor *whatever
*/ union { union key_payload payload; struct { /* Keyring bits */ struct list_head name_link; struct assoc_array keys;
};
};
/* This is set on a keyring to restrict the addition of a link to a key *toit.Ifthisstructureisn'tprovidedthenitisassumedthatthe *keyringisopentoanyaddition.Itisignoredfornon-keyring *keys.Onlysetthisvalueusingkeyring_restrict(),keyring_alloc(), *orkey_alloc(). * *Thisisintendedforusewithringsoftrustedkeyswherebyaddition *tothekeyringneedstobecontrolled.KEY_ALLOC_BYPASS_RESTRICTION *overridesthis,allowingthekerneltoaddextrakeyswithout *restriction.
*/ struct key_restriction *restrict_link;
};
#define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */ #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ #define KEY_ALLOC_BUILT_IN 0x0004 /* Key is built into kernel */ #define KEY_ALLOC_BYPASS_RESTRICTION 0x0008 /* Override the check on restricted keyrings */ #define KEY_ALLOC_UID_KEYRING 0x0010 /* allocating a user or user session keyring */ #define KEY_ALLOC_SET_KEEP 0x0020 /* Set the KEEP flag on the key/keyring */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.