Lines Matching refs:db
1135 struct token_persistent_main *db = token->db_main; in check_so_pin() local
1138 assert(db->flags & PKCS11_CKFT_TOKEN_INITIALIZED); in check_so_pin()
1141 db->flags & PKCS11_CKFT_PROTECTED_AUTHENTICATION_PATH) in check_so_pin()
1144 if (db->flags & PKCS11_CKFT_SO_PIN_LOCKED) in check_so_pin()
1151 db->flags |= PKCS11_CKFT_SO_PIN_COUNT_LOW; in check_so_pin()
1152 db->so_pin_count++; in check_so_pin()
1154 if (db->so_pin_count == PKCS11_TOKEN_SO_PIN_COUNT_MAX - 1) in check_so_pin()
1155 db->flags |= PKCS11_CKFT_SO_PIN_FINAL_TRY; in check_so_pin()
1156 else if (db->so_pin_count == PKCS11_TOKEN_SO_PIN_COUNT_MAX) in check_so_pin()
1157 db->flags |= PKCS11_CKFT_SO_PIN_LOCKED; in check_so_pin()
1162 db->so_pin_salt, in check_so_pin()
1163 db->so_pin_hash); in check_so_pin()
1165 if (db->flags & PKCS11_CKFT_SO_PIN_LOCKED) in check_so_pin()
1172 db->so_pin_count--; in check_so_pin()
1174 db->so_pin_count = 0; in check_so_pin()
1176 db->flags &= ~PKCS11_CKFT_SO_PIN_LOCKED; in check_so_pin()
1177 if (db->so_pin_count < PKCS11_TOKEN_SO_PIN_COUNT_MAX - 1) { in check_so_pin()
1178 db->flags &= ~PKCS11_CKFT_SO_PIN_FINAL_TRY; in check_so_pin()
1179 if (!db->so_pin_count) in check_so_pin()
1180 db->flags &= ~PKCS11_CKFT_SO_PIN_COUNT_LOW; in check_so_pin()
1192 struct token_persistent_main *db = token->db_main; in check_user_pin() local
1195 if (!(db->flags & PKCS11_CKFT_USER_PIN_INITIALIZED)) in check_user_pin()
1199 db->flags & PKCS11_CKFT_PROTECTED_AUTHENTICATION_PATH) in check_user_pin()
1202 assert(db->user_pin_salt); in check_user_pin()
1204 if (db->flags & PKCS11_CKFT_USER_PIN_LOCKED) in check_user_pin()
1211 db->flags |= PKCS11_CKFT_USER_PIN_COUNT_LOW; in check_user_pin()
1212 db->user_pin_count++; in check_user_pin()
1214 if (db->user_pin_count == PKCS11_TOKEN_USER_PIN_COUNT_MAX - 1) in check_user_pin()
1215 db->flags |= PKCS11_CKFT_USER_PIN_FINAL_TRY; in check_user_pin()
1216 else if (db->user_pin_count == PKCS11_TOKEN_USER_PIN_COUNT_MAX) in check_user_pin()
1217 db->flags |= PKCS11_CKFT_USER_PIN_LOCKED; in check_user_pin()
1222 db->user_pin_salt, in check_user_pin()
1223 db->user_pin_hash); in check_user_pin()
1225 if (db->flags & PKCS11_CKFT_USER_PIN_LOCKED) in check_user_pin()
1232 db->user_pin_count--; in check_user_pin()
1234 db->user_pin_count = 0; in check_user_pin()
1236 db->flags &= ~PKCS11_CKFT_USER_PIN_LOCKED; in check_user_pin()
1237 if (db->user_pin_count < PKCS11_TOKEN_USER_PIN_COUNT_MAX - 1) { in check_user_pin()
1238 db->flags &= ~PKCS11_CKFT_USER_PIN_FINAL_TRY; in check_user_pin()
1239 if (!db->user_pin_count) in check_user_pin()
1240 db->flags &= ~PKCS11_CKFT_USER_PIN_COUNT_LOW; in check_user_pin()