WARNING: line length of 87 exceeds 80 columns #47: FILE: net/quic/crypto.c:204: +static void *quic_crypto_skcipher_mem_alloc(struct crypto_skcipher *tfm, u32 mask_size, WARNING: line length of 83 exceeds 80 columns #48: FILE: net/quic/crypto.c:205: + u8 **iv, struct skcipher_request **req) WARNING: line length of 82 exceeds 80 columns #59: FILE: net/quic/crypto.c:216: + len += crypto_skcipher_alignmask(tfm) & ~(crypto_tfm_ctx_alignment() - 1); WARNING: line length of 83 exceeds 80 columns #67: FILE: net/quic/crypto.c:224: + *iv = (u8 *)PTR_ALIGN(mem + mask_size, crypto_skcipher_alignmask(tfm) + 1); WARNING: line length of 100 exceeds 80 columns #82: FILE: net/quic/crypto.c:239: +static int quic_crypto_header_encrypt(struct crypto_skcipher *tfm, struct sk_buff *skb, bool chacha) WARNING: line length of 85 exceeds 80 columns #113: FILE: net/quic/crypto.c:270: + memcpy((chacha ? iv : mask), skb->data + cb->number_offset + QUIC_MAX_PN_LEN, WARNING: line length of 90 exceeds 80 columns #138: FILE: net/quic/crypto.c:295: + *p = (u8)(*p ^ (mask[0] & (((*p & QUIC_HEADER_FORM_BIT) == QUIC_HEADER_FORM_BIT) ? WARNING: line length of 85 exceeds 80 columns #139: FILE: net/quic/crypto.c:296: + QUIC_LONG_HEADER_MASK : QUIC_SHORT_HEADER_MASK))); WARNING: line length of 96 exceeds 80 columns #158: FILE: net/quic/crypto.c:315: + * Once header protection is removed, the packet number is decoded by finding the packet WARNING: line length of 96 exceeds 80 columns #159: FILE: net/quic/crypto.c:316: + * number value that is closest to the next expected packet. The next expected packet is WARNING: line length of 100 exceeds 80 columns #174: FILE: net/quic/crypto.c:331: +static int quic_crypto_header_decrypt(struct crypto_skcipher *tfm, struct sk_buff *skb, bool chacha) WARNING: line length of 90 exceeds 80 columns #203: FILE: net/quic/crypto.c:360: + *p = (u8)(*p ^ (mask[0] & (((*p & QUIC_HEADER_FORM_BIT) == QUIC_HEADER_FORM_BIT) ? WARNING: line length of 85 exceeds 80 columns #204: FILE: net/quic/crypto.c:361: + QUIC_LONG_HEADER_MASK : QUIC_SHORT_HEADER_MASK))); WARNING: line length of 84 exceeds 80 columns #262: FILE: net/quic/crypto.c:419: +static int quic_crypto_payload_encrypt(struct crypto_aead *tfm, struct sk_buff *skb, WARNING: line length of 83 exceeds 80 columns #295: FILE: net/quic/crypto.c:452: + * The associated data, A, for the AEAD is the contents of the QUIC header, WARNING: line length of 85 exceeds 80 columns #296: FILE: net/quic/crypto.c:453: + * starting from the first byte of either the short or long header, up to and WARNING: line length of 88 exceeds 80 columns #299: FILE: net/quic/crypto.c:456: + * The nonce, N, is formed by combining the packet protection IV with the packet WARNING: line length of 87 exceeds 80 columns #300: FILE: net/quic/crypto.c:457: + * number. The 62 bits of the reconstructed QUIC packet number in network byte WARNING: line length of 90 exceeds 80 columns #301: FILE: net/quic/crypto.c:458: + * order are left-padded with zeros to the size of the IV. The exclusive OR of the WARNING: line length of 98 exceeds 80 columns #316: FILE: net/quic/crypto.c:473: + aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, (void *)quic_crypto_done, skb); WARNING: line length of 83 exceeds 80 columns #320: FILE: net/quic/crypto.c:477: + /* Will complete asynchronously; set destructor to free context. */ WARNING: line length of 84 exceeds 80 columns #331: FILE: net/quic/crypto.c:488: +static int quic_crypto_payload_decrypt(struct crypto_aead *tfm, struct sk_buff *skb, WARNING: line length of 98 exceeds 80 columns #371: FILE: net/quic/crypto.c:528: + aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, (void *)quic_crypto_done, skb); WARNING: line length of 89 exceeds 80 columns #401: FILE: net/quic/crypto.c:575: +/* Encrypts a QUIC packet before transmission. This function performs AEAD encryption of WARNING: line length of 90 exceeds 80 columns #402: FILE: net/quic/crypto.c:576: + * the packet payload and applies header protection. It handles key phase tracking and key WARNING: line length of 92 exceeds 80 columns #415: FILE: net/quic/crypto.c:589: + /* Packet payload is already encrypted (e.g., resumed from async), proceed to header WARNING: line length of 94 exceeds 80 columns #421: FILE: net/quic/crypto.c:595: + /* If a key update is pending and this is the first packet using the new key, save the WARNING: line length of 85 exceeds 80 columns #422: FILE: net/quic/crypto.c:596: + * current time. Later used to clear old keys after some time has passed (see WARNING: line length of 84 exceeds 80 columns #437: FILE: net/quic/crypto.c:611: +/* Decrypts a QUIC packet after reception. This function removes header protection, WARNING: line length of 84 exceeds 80 columns #438: FILE: net/quic/crypto.c:612: + * decrypts the payload, and processes any key updates if the key phase bit changes. WARNING: line length of 92 exceeds 80 columns #449: FILE: net/quic/crypto.c:623: + /* Payload was decrypted asynchronously. Proceed with parsing packet number and key WARNING: line length of 93 exceeds 80 columns #466: FILE: net/quic/crypto.c:640: + * The Key Phase bit allows a recipient to detect a change in keying material without WARNING: line length of 90 exceeds 80 columns #467: FILE: net/quic/crypto.c:641: + * needing to receive the first packet that triggered the change. An endpoint that WARNING: line length of 93 exceeds 80 columns #468: FILE: net/quic/crypto.c:642: + * notices a changed Key Phase bit updates keys and decrypts the packet that contains WARNING: line length of 81 exceeds 80 columns #474: FILE: net/quic/crypto.c:648: + err = quic_crypto_key_update(crypto); /* Perform a key update. */ WARNING: line length of 86 exceeds 80 columns #489: FILE: net/quic/crypto.c:663: + /* When using the old keys can not decrypt the packets, the peer might WARNING: line length of 85 exceeds 80 columns #490: FILE: net/quic/crypto.c:664: + * start another key_update. Thus, clear the last key_pending so that WARNING: line length of 83 exceeds 80 columns #503: FILE: net/quic/crypto.c:677: + * An endpoint MUST retain old keys until it has successfully unprotected a WARNING: line length of 81 exceeds 80 columns #504: FILE: net/quic/crypto.c:678: + * packet sent using the new keys. An endpoint SHOULD retain old keys for WARNING: line length of 90 exceeds 80 columns #509: FILE: net/quic/crypto.c:683: + if (time && jiffies_to_usecs(jiffies) - time >= crypto->key_update_time) { WARNING: line length of 87 exceeds 80 columns #543: FILE: net/quic/crypto.c:989: + * The Retry Integrity Tag is a 128-bit field that is computed as the output of WARNING: line length of 88 exceeds 80 columns #546: FILE: net/quic/crypto.c:992: + * - The secret key, K, is 128 bits equal to 0xbe0c690b9f66575a1d766b54e368c84e. WARNING: line length of 90 exceeds 80 columns #551: FILE: net/quic/crypto.c:997: + * The Retry Pseudo-Packet is not sent over the wire. It is computed by taking the WARNING: line length of 89 exceeds 80 columns #552: FILE: net/quic/crypto.c:998: + * transmitted Retry packet, removing the Retry Integrity Tag, and prepending the WARNING: line length of 91 exceeds 80 columns #553: FILE: net/quic/crypto.c:999: + * two following fields: ODCID Length + Original Destination Connection ID (ODCID). WARNING: line length of 95 exceeds 80 columns #566: FILE: net/quic/crypto.c:1012: + pseudo_retry = quic_crypto_aead_mem_alloc(tfm, plen + QUIC_TAG_LEN, &iv, &req, &sg, 1); WARNING: line length of 87 exceeds 80 columns #591: FILE: net/quic/crypto.c:1037: + * Builds a token with the format: [client address][timestamp][original DCID][auth tag] WARNING: line length of 85 exceeds 80 columns #593: FILE: net/quic/crypto.c:1039: + * Encrypts the token (excluding the first flag byte) using AES-GCM with a key and IV WARNING: line length of 84 exceeds 80 columns #594: FILE: net/quic/crypto.c:1040: + * derived via HKDF. The original DCID is stored to be recovered later from a Client WARNING: line length of 89 exceeds 80 columns #595: FILE: net/quic/crypto.c:1041: + * Initial packet. Ensures the token is bound to the client address and time, preventing WARNING: line length of 83 exceeds 80 columns #600: FILE: net/quic/crypto.c:1046: +int quic_crypto_generate_token(struct quic_crypto *crypto, void *addr, u32 addrlen, WARNING: line length of 82 exceeds 80 columns #601: FILE: net/quic/crypto.c:1047: + struct quic_conn_id *conn_id, u8 *token, u32 *tlen) WARNING: line length of 91 exceeds 80 columns #603: FILE: net/quic/crypto.c:1049: + u8 key[TLS_CIPHER_AES_GCM_128_KEY_SIZE], iv[QUIC_IV_LEN], *retry_token, *tx_iv, *p; WARNING: line length of 95 exceeds 80 columns #614: FILE: net/quic/crypto.c:1060: + err = quic_crypto_keys_derive(crypto->secret_tfm, &srt, &k, &i, NULL, QUIC_VERSION_V1); WARNING: line length of 81 exceeds 80 columns #625: FILE: net/quic/crypto.c:1071: + retry_token = quic_crypto_aead_mem_alloc(tfm, len, &tx_iv, &req, &sg, 1); WARNING: line length of 89 exceeds 80 columns #648: FILE: net/quic/crypto.c:1094: + * Decrypts the token using derived key and IV. Checks that the decrypted address matches WARNING: line length of 85 exceeds 80 columns #649: FILE: net/quic/crypto.c:1095: + * the provided address, validates the embedded timestamp against current time with a WARNING: line length of 87 exceeds 80 columns #653: FILE: net/quic/crypto.c:1099: + * Returns 0 if the token is valid, -EINVAL if invalid, or another negative error code. WARNING: line length of 81 exceeds 80 columns #655: FILE: net/quic/crypto.c:1101: +int quic_crypto_verify_token(struct quic_crypto *crypto, void *addr, u32 addrlen, WARNING: line length of 95 exceeds 80 columns #671: FILE: net/quic/crypto.c:1117: + err = quic_crypto_keys_derive(crypto->secret_tfm, &srt, &k, &i, NULL, QUIC_VERSION_V1); WARNING: line length of 81 exceeds 80 columns #682: FILE: net/quic/crypto.c:1128: + retry_token = quic_crypto_aead_mem_alloc(tfm, len, &rx_iv, &req, &sg, 1); WARNING: line length of 83 exceeds 80 columns #738: FILE: net/quic/crypto.h:75: +int quic_crypto_generate_token(struct quic_crypto *crypto, void *addr, u32 addrlen, WARNING: line length of 83 exceeds 80 columns #739: FILE: net/quic/crypto.h:76: + struct quic_conn_id *conn_id, u8 *token, u32 *tlen); WARNING: line length of 81 exceeds 80 columns #742: FILE: net/quic/crypto.h:79: +int quic_crypto_verify_token(struct quic_crypto *crypto, void *addr, u32 addrlen, total: 0 errors, 64 warnings, 0 checks, 695 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 83e94812eea4 ("quic: add crypto packet encryption and decryption") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 64 warnings, 0 checks, 695 lines checked