WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #59: new file mode 100644 WARNING: line length of 84 exceeds 80 columns #91: FILE: net/quic/crypto.c:28: +static int quic_crypto_hkdf_extract(struct crypto_shash *tfm, struct quic_data *srt, WARNING: line length of 82 exceeds 80 columns #92: FILE: net/quic/crypto.c:29: + struct quic_data *hash, struct quic_data *key) WARNING: line length of 88 exceeds 80 columns #94: FILE: net/quic/crypto.c:31: + return hkdf_extract(tfm, hash->data, hash->len, srt->data, srt->len, key->data); WARNING: line length of 83 exceeds 80 columns #100: FILE: net/quic/crypto.c:37: +static int quic_crypto_hkdf_expand(struct crypto_shash *tfm, struct quic_data *srt, WARNING: line length of 83 exceeds 80 columns #101: FILE: net/quic/crypto.c:38: + struct quic_data *label, struct quic_data *hash, WARNING: line length of 93 exceeds 80 columns #150: FILE: net/quic/crypto.c:87: + * The labels used in rfc9001 to derive packet protection keys, header protection keys, Retry WARNING: line length of 93 exceeds 80 columns #151: FILE: net/quic/crypto.c:88: + * Integrity Tag keys, and key updates change from "quic key" to "quicv2 key", from "quic iv" WARNING: line length of 84 exceeds 80 columns #152: FILE: net/quic/crypto.c:89: + * to "quicv2 iv", from "quic hp" to "quicv2 hp", and from "quic ku" to "quicv2 ku". WARNING: line length of 81 exceeds 80 columns #161: FILE: net/quic/crypto.c:98: +static int quic_crypto_keys_derive(struct crypto_shash *tfm, struct quic_data *s, WARNING: line length of 88 exceeds 80 columns #173: FILE: net/quic/crypto.c:110: + * The current encryption level secret and the label "quic key" are input to the WARNING: line length of 81 exceeds 80 columns #174: FILE: net/quic/crypto.c:111: + * KDF to produce the AEAD key; the label "quic iv" is used to derive the WARNING: line length of 90 exceeds 80 columns #175: FILE: net/quic/crypto.c:112: + * Initialization Vector (IV). The header protection key uses the "quic hp" label. WARNING: line length of 89 exceeds 80 columns #197: FILE: net/quic/crypto.c:134: +/* Derive and install transmission (TX) packet protection keys for the current key phase. WARNING: line length of 90 exceeds 80 columns #198: FILE: net/quic/crypto.c:135: + * This involves generating AEAD encryption key, IV, and optionally header protection key. WARNING: line length of 94 exceeds 80 columns #214: FILE: net/quic/crypto.c:151: + err = quic_crypto_keys_derive(crypto->secret_tfm, &srt, &k, &iv, hp, crypto->version); WARNING: line length of 83 exceeds 80 columns #224: FILE: net/quic/crypto.c:161: + err = crypto_skcipher_setkey(crypto->tx_hp_tfm, tx_hp_key, keylen); WARNING: line length of 99 exceeds 80 columns #228: FILE: net/quic/crypto.c:165: + pr_debug("%s: k: %16phN, iv: %12phN, hp_k:%16phN\n", __func__, k.data, iv.data, hp_k.data); WARNING: line length of 86 exceeds 80 columns #232: FILE: net/quic/crypto.c:169: +/* Derive and install reception (RX) packet protection keys for the current key phase. WARNING: line length of 94 exceeds 80 columns #249: FILE: net/quic/crypto.c:186: + err = quic_crypto_keys_derive(crypto->secret_tfm, &srt, &k, &iv, hp, crypto->version); WARNING: line length of 83 exceeds 80 columns #259: FILE: net/quic/crypto.c:196: + err = crypto_skcipher_setkey(crypto->rx_hp_tfm, rx_hp_key, keylen); WARNING: line length of 99 exceeds 80 columns #263: FILE: net/quic/crypto.c:200: + pr_debug("%s: k: %16phN, iv: %12phN, hp_k:%16phN\n", __func__, k.data, iv.data, hp_k.data); WARNING: line length of 86 exceeds 80 columns #275: FILE: net/quic/crypto.c:212: +#define CIPHER_DESC(type, aead_name, skc_name, sha_name)[type - QUIC_CIPHER_MIN] = { \ WARNING: line length of 84 exceeds 80 columns #284: FILE: net/quic/crypto.c:221: + CIPHER_DESC(TLS_CIPHER_AES_GCM_128, "gcm(aes)", "ecb(aes)", "hmac(sha256)"), WARNING: line length of 84 exceeds 80 columns #285: FILE: net/quic/crypto.c:222: + CIPHER_DESC(TLS_CIPHER_AES_GCM_256, "gcm(aes)", "ecb(aes)", "hmac(sha384)"), WARNING: line length of 84 exceeds 80 columns #286: FILE: net/quic/crypto.c:223: + CIPHER_DESC(TLS_CIPHER_AES_CCM_128, "ccm(aes)", "ecb(aes)", "hmac(sha256)"), WARNING: line length of 86 exceeds 80 columns #364: FILE: net/quic/crypto.c:301: +int quic_crypto_set_secret(struct quic_crypto *crypto, struct quic_crypto_secret *srt, WARNING: line length of 82 exceeds 80 columns #379: FILE: net/quic/crypto.c:316: + memcpy(crypto->rx_secret, srt->secret, crypto->cipher->secretlen); WARNING: line length of 86 exceeds 80 columns #397: FILE: net/quic/crypto.c:334: +int quic_crypto_get_secret(struct quic_crypto *crypto, struct quic_crypto_secret *srt) WARNING: line length of 87 exceeds 80 columns #423: FILE: net/quic/crypto.c:360: + * Endpoints maintain separate read and write secrets for packet protection. An WARNING: line length of 89 exceeds 80 columns #424: FILE: net/quic/crypto.c:361: + * endpoint initiates a key update by updating its packet protection write secret WARNING: line length of 89 exceeds 80 columns #425: FILE: net/quic/crypto.c:362: + * and using that to protect new packets. The endpoint creates a new write secret WARNING: line length of 90 exceeds 80 columns #426: FILE: net/quic/crypto.c:363: + * from the existing write secret. This uses the KDF function provided by TLS with WARNING: line length of 83 exceeds 80 columns #427: FILE: net/quic/crypto.c:364: + * a label of "quic ku". The corresponding key and IV are created from that WARNING: line length of 87 exceeds 80 columns #430: FILE: net/quic/crypto.c:367: + * For example,to update write keys with TLS 1.3, HKDF-Expand-Label is used as: WARNING: line length of 94 exceeds 80 columns #499: FILE: net/quic/crypto.c:436: +int quic_crypto_initial_keys_install(struct quic_crypto *crypto, struct quic_conn_id *conn_id, WARNING: line length of 87 exceeds 80 columns #510: FILE: net/quic/crypto.c:447: + * The secret used by clients to construct Initial packets uses the PRK and the WARNING: line length of 88 exceeds 80 columns #511: FILE: net/quic/crypto.c:448: + * label "client in" as input to the HKDF-Expand-Label function from TLS [TLS13] WARNING: line length of 86 exceeds 80 columns #512: FILE: net/quic/crypto.c:449: + * to produce a 32-byte secret. Packets constructed by the server use the same WARNING: line length of 87 exceeds 80 columns #513: FILE: net/quic/crypto.c:450: + * process with the label "server in". The hash function for HKDF when deriving WARNING: line length of 92 exceeds 80 columns #553: FILE: net/quic/crypto.c:490: + /* Enforce synchronous crypto for Initial level by requesting algorithms marked with WARNING: line length of 83 exceeds 80 columns #570: FILE: net/quic/crypto.c:507: +/* Generate a derived key using HKDF-Extract and HKDF-Expand with a given label. */ WARNING: line length of 84 exceeds 80 columns #571: FILE: net/quic/crypto.c:508: +static int quic_crypto_generate_key(struct quic_crypto *crypto, void *data, u32 len, WARNING: line length of 86 exceeds 80 columns #592: FILE: net/quic/crypto.c:529: +int quic_crypto_generate_stateless_reset_token(struct quic_crypto *crypto, void *data, WARNING: line length of 92 exceeds 80 columns #595: FILE: net/quic/crypto.c:532: + return quic_crypto_generate_key(crypto, data, len, "stateless_reset", key, key_len); WARNING: line length of 83 exceeds 80 columns #599: FILE: net/quic/crypto.c:536: +int quic_crypto_generate_session_ticket_key(struct quic_crypto *crypto, void *data, WARNING: line length of 91 exceeds 80 columns #602: FILE: net/quic/crypto.c:539: + return quic_crypto_generate_key(crypto, data, len, "session_ticket", key, key_len); WARNING: line length of 92 exceeds 80 columns #639: FILE: net/quic/crypto.h:25: + char *shash; /* Name of hash algorithm used for key derivation */ WARNING: line length of 99 exceeds 80 columns #640: FILE: net/quic/crypto.h:26: + char *aead; /* Name of AEAD algorithm used for payload en/decryption */ WARNING: line length of 97 exceeds 80 columns #641: FILE: net/quic/crypto.h:27: + char *skc; /* Name of cipher algorithm used for header protection */ WARNING: line length of 88 exceeds 80 columns #645: FILE: net/quic/crypto.h:31: + struct crypto_skcipher *tx_hp_tfm; /* Transform for TX header protection */ WARNING: line length of 88 exceeds 80 columns #646: FILE: net/quic/crypto.h:32: + struct crypto_skcipher *rx_hp_tfm; /* Transform for RX header protection */ WARNING: line length of 89 exceeds 80 columns #647: FILE: net/quic/crypto.h:33: + struct crypto_shash *secret_tfm; /* Transform for key derivation (HKDF) */ WARNING: line length of 95 exceeds 80 columns #648: FILE: net/quic/crypto.h:34: + struct crypto_aead *tx_tfm[2]; /* AEAD transform for TX (key phase 0 and 1) */ WARNING: line length of 95 exceeds 80 columns #649: FILE: net/quic/crypto.h:35: + struct crypto_aead *rx_tfm[2]; /* AEAD transform for RX (key phase 0 and 1) */ WARNING: line length of 100 exceeds 80 columns #650: FILE: net/quic/crypto.h:36: + struct crypto_aead *tag_tfm; /* AEAD transform used for Retry token validation */ WARNING: line length of 96 exceeds 80 columns #651: FILE: net/quic/crypto.h:37: + struct quic_cipher *cipher; /* Cipher information (selected cipher suite) */ WARNING: line length of 92 exceeds 80 columns #652: FILE: net/quic/crypto.h:38: + u32 cipher_type; /* Cipher suite (e.g., AES_GCM_128, etc.) */ WARNING: line length of 97 exceeds 80 columns #654: FILE: net/quic/crypto.h:40: + u8 tx_secret[QUIC_SECRET_LEN]; /* TX secret derived or provided by user space */ WARNING: line length of 97 exceeds 80 columns #655: FILE: net/quic/crypto.h:41: + u8 rx_secret[QUIC_SECRET_LEN]; /* RX secret derived or provided by user space */ WARNING: line length of 84 exceeds 80 columns #656: FILE: net/quic/crypto.h:42: + u8 tx_iv[2][QUIC_IV_LEN]; /* IVs for TX (key phase 0 and 1) */ WARNING: line length of 84 exceeds 80 columns #657: FILE: net/quic/crypto.h:43: + u8 rx_iv[2][QUIC_IV_LEN]; /* IVs for RX (key phase 0 and 1) */ WARNING: line length of 100 exceeds 80 columns #659: FILE: net/quic/crypto.h:45: + u32 key_update_send_time; /* Time when 1st packet was sent after key update */ WARNING: line length of 94 exceeds 80 columns #660: FILE: net/quic/crypto.h:46: + u32 key_update_time; /* Time to retain old keys after key update */ WARNING: line length of 96 exceeds 80 columns #663: FILE: net/quic/crypto.h:49: + u8 ticket_ready:1; /* True if a session ticket is ready to read */ WARNING: line length of 81 exceeds 80 columns #664: FILE: net/quic/crypto.h:50: + u8 key_pending:1; /* A key update is in progress */ WARNING: line length of 90 exceeds 80 columns #665: FILE: net/quic/crypto.h:51: + u8 send_ready:1; /* TX encryption context is initialized */ WARNING: line length of 90 exceeds 80 columns #666: FILE: net/quic/crypto.h:52: + u8 recv_ready:1; /* RX decryption context is initialized */ WARNING: line length of 91 exceeds 80 columns #667: FILE: net/quic/crypto.h:53: + u8 key_phase:1; /* Current key phase being used (0 or 1) */ WARNING: line length of 90 exceeds 80 columns #669: FILE: net/quic/crypto.h:55: + u64 send_offset; /* Number of handshake bytes sent by user at this level */ WARNING: line length of 90 exceeds 80 columns #670: FILE: net/quic/crypto.h:56: + u64 recv_offset; /* Number of handshake bytes read by user at this level */ WARNING: line length of 86 exceeds 80 columns #673: FILE: net/quic/crypto.h:59: +int quic_crypto_set_secret(struct quic_crypto *crypto, struct quic_crypto_secret *srt, WARNING: line length of 87 exceeds 80 columns #675: FILE: net/quic/crypto.h:61: +int quic_crypto_get_secret(struct quic_crypto *crypto, struct quic_crypto_secret *srt); WARNING: line length of 94 exceeds 80 columns #679: FILE: net/quic/crypto.h:65: +int quic_crypto_initial_keys_install(struct quic_crypto *crypto, struct quic_conn_id *conn_id, WARNING: line length of 83 exceeds 80 columns #681: FILE: net/quic/crypto.h:67: +int quic_crypto_generate_session_ticket_key(struct quic_crypto *crypto, void *data, WARNING: line length of 86 exceeds 80 columns #683: FILE: net/quic/crypto.h:69: +int quic_crypto_generate_stateless_reset_token(struct quic_crypto *crypto, void *data, WARNING: line length of 92 exceeds 80 columns #696: FILE: net/quic/protocol.c:261: + err = quic_crypto_set_cipher(&qn->crypto, TLS_CIPHER_AES_GCM_128, CRYPTO_ALG_ASYNC); WARNING: line length of 93 exceeds 80 columns #736: FILE: net/quic/protocol.h:50: + struct quic_crypto crypto; /* Context for decrypting Initial packets for ALPN */ WARNING: line length of 98 exceeds 80 columns #737: FILE: net/quic/protocol.h:51: + spinlock_t lock; /* Lock protecting crypto context for Initial packet decryption */ total: 0 errors, 79 warnings, 0 checks, 697 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 e41c0a12dc10 ("quic: add crypto key derivation and installation") 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, 79 warnings, 0 checks, 697 lines checked