* - text descriptions prefixed with "%:" or "%keyring:".
* - text description with no prefix.
* - numeric keyring id (ignored in current patch set). */
- if (*val == '@' || *val == '%')
+ if (IN_SET(*val, '@', '%'))
keyring = strndup(val, sep - val);
else
/* add type prefix if missing (crypt_set_keyring_to_link() expects it) */
switch (attributes[i].type) {
case CKA_CLASS: {
CK_OBJECT_CLASS requested_class = *((CK_OBJECT_CLASS*) attributes[i].pValue);
- if (requested_class != CKO_PUBLIC_KEY && requested_class != CKO_CERTIFICATE)
+ if (!IN_SET(requested_class, CKO_PUBLIC_KEY, CKO_CERTIFICATE))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Selected PKCS#11 object is not a public key or certificate, refusing.");
break;
candidate_attributes[0].ulValueLen = sizeof(class);
candidate_attributes[1].ulValueLen = sizeof(type);
rv = m->C_GetAttributeValue(session, candidate, candidate_attributes, ELEMENTSOF(candidate_attributes));
- if (rv != CKR_OK && rv != CKR_ATTRIBUTE_TYPE_INVALID)
+ if (!IN_SET(rv, CKR_OK, CKR_ATTRIBUTE_TYPE_INVALID))
return log_error_errno(SYNTHETIC_ERRNO(EIO),
"Failed to get attributes of a selected candidate: %s", sym_p11_kit_strerror(rv));
* since we cannot lookahead to see if the Esc is followed by a \
* we cut a corner here and assume it will be \. */
- if (c == '\x07' || c == '\x1b') {
+ if (IN_SET(c, '\x07', '\x1b')) {
r = insert_window_title_fix(f, i+1);
if (r < 0)
return r;