History

rxrpc: Allow CHALLENGEs to the passed to the app for a RESPONSE

Allow the app to request that CHALLENGEs be passed to it through an out-of-band queue that allows recvmsg() to pick it up so that the app can add data to it with sendmsg(). This will allow the application (AFS or userspace) to interact with the process if it wants to and put values into user-defined fields. This will be used by AFS when talking to a fileserver to supply that fileserver with a crypto key by which callback RPCs can be encrypted (ie. notifications from the fileserver to the client).

David Howells committed 1 year ago

Commit 5800b1c1 parent 019c84323 files · +1188 −165Browse files

Showing the changes to include/uapi/linux (1 of 23 files). Show all

Unified · Split

include/uapi/linux/rxrpc.h+34−12
@@ -36,26 +36,33 @@ struct sockaddr_rxrpc { · 35 unmodified lines
3636 #define RXRPC_MIN_SECURITY_LEVEL 4 /* minimum security level */
3737 #define RXRPC_UPGRADEABLE_SERVICE 5 /* Upgrade service[0] -> service[1] */
3838 #define RXRPC_SUPPORTED_CMSG 6 /* Get highest supported control message type */
39+#define RXRPC_MANAGE_RESPONSE 7 /* [clnt] Want to manage RESPONSE packets */
3940
4041 /*
4142 * RxRPC control messages
4243 * - If neither abort or accept are specified, the message is a data message.
4344 * - terminal messages mean that a user call ID tag can be recycled
45+ * - C/S/- indicate whether these are applicable to client, server or both
4446 * - s/r/- indicate whether these are applicable to sendmsg() and/or recvmsg()
4547 */
4648 enum rxrpc_cmsg_type {
47− RXRPC_USER_CALL_ID = 1, /* sr: user call ID specifier */
48− RXRPC_ABORT = 2, /* sr: abort request / notification [terminal] */
49− RXRPC_ACK = 3, /* -r: [Service] RPC op final ACK received [terminal] */
50− RXRPC_NET_ERROR = 5, /* -r: network error received [terminal] */
51− RXRPC_BUSY = 6, /* -r: server busy received [terminal] */
52− RXRPC_LOCAL_ERROR = 7, /* -r: local error generated [terminal] */
53− RXRPC_NEW_CALL = 8, /* -r: [Service] new incoming call notification */
54− RXRPC_EXCLUSIVE_CALL = 10, /* s-: Call should be on exclusive connection */
55− RXRPC_UPGRADE_SERVICE = 11, /* s-: Request service upgrade for client call */
56− RXRPC_TX_LENGTH = 12, /* s-: Total length of Tx data */
57− RXRPC_SET_CALL_TIMEOUT = 13, /* s-: Set one or more call timeouts */
58− RXRPC_CHARGE_ACCEPT = 14, /* s-: Charge the accept pool with a user call ID */
49+ RXRPC_USER_CALL_ID = 1, /* -sr: User call ID specifier */
50+ RXRPC_ABORT = 2, /* -sr: Abort request / notification [terminal] */
51+ RXRPC_ACK = 3, /* S-r: RPC op final ACK received [terminal] */
52+ RXRPC_NET_ERROR = 5, /* --r: Network error received [terminal] */
53+ RXRPC_BUSY = 6, /* C-r: Server busy received [terminal] */
54+ RXRPC_LOCAL_ERROR = 7, /* --r: Local error generated [terminal] */
55+ RXRPC_NEW_CALL = 8, /* S-r: New incoming call notification */
56+ RXRPC_EXCLUSIVE_CALL = 10, /* Cs-: Call should be on exclusive connection */
57+ RXRPC_UPGRADE_SERVICE = 11, /* Cs-: Request service upgrade for client call */
58+ RXRPC_TX_LENGTH = 12, /* -s-: Total length of Tx data */
59+ RXRPC_SET_CALL_TIMEOUT = 13, /* -s-: Set one or more call timeouts */
60+ RXRPC_CHARGE_ACCEPT = 14, /* Ss-: Charge the accept pool with a user call ID */
61+ RXRPC_OOB_ID = 15, /* -sr: OOB message ID */
62+ RXRPC_CHALLENGED = 16, /* C-r: Info on a received CHALLENGE */
63+ RXRPC_RESPOND = 17, /* Cs-: Respond to a challenge */
64+ RXRPC_RESPONDED = 18, /* S-r: Data received in RESPONSE */
65+ RXRPC_RESP_RXGK_APPDATA = 19, /* Cs-: RESPONSE: RxGK app data to include */
5966 RXRPC__SUPPORTED
6067 };
6168
@@ -118,4 +125,19 @@ enum rxrpc_cmsg_type { · 56 unmodified lines
118125 #define RXKADDATALEN 19270411 /* user data too long */
119126 #define RXKADILLEGALLEVEL 19270412 /* caller not authorised to use encrypted conns */
120127
128+/*
129+ * Challenge information in the RXRPC_CHALLENGED control message.
130+ */
131+struct rxrpc_challenge {
132+ __u16 service_id; /* The service ID of the connection (may be upgraded) */
133+ __u8 security_index; /* The security index of the connection */
134+ __u8 pad; /* Round out to a multiple of 4 bytes. */
135+ /* ... The security class gets to append extra information ... */
136+};
137+
138+struct rxgk_challenge {
139+ struct rxrpc_challenge base;
140+ __u32 enctype; /* Krb5 encoding type */
141+};
142+
121143 #endif /* _UAPI_LINUX_RXRPC_H */