if (!send_message_callback_) {Please fix this WARNING reported by autoreview issue finding: It's slightly more efficient and logical to move this null-check before storing the callback and starting the timer, so we avoid that work if we're just going to drop the request.
```cpp
if (!send_message_callback_) {
LOG(ERROR) << "send_message_callback_ is null, dropping request.";
CloseSecurityKeyRequestConnection(connection_id);
return;
}
// Reset the timer to give the client a chance to send the response.
connection.disconnect_timer.Start(FROM_HERE, kSecurityKeyRequestTimeout,
GetCloseConnectionClosure(connection_id));
connection.on_security_key_request_callback = std::move(callback);
```
auth_handler_->SetSendMessageCallback(base::NullCallback());Please fix this WARNING reported by autoreview issue finding: Please add `#include "base/functional/callback_helpers.h"` for `base::NullCallback()`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
Please fix this WARNING reported by autoreview issue finding: It's slightly more efficient and logical to move this null-check before storing the callback and starting the timer, so we avoid that work if we're just going to drop the request.
```cpp
if (!send_message_callback_) {
LOG(ERROR) << "send_message_callback_ is null, dropping request.";
CloseSecurityKeyRequestConnection(connection_id);
return;
}// Reset the timer to give the client a chance to send the response.
connection.disconnect_timer.Start(FROM_HERE, kSecurityKeyRequestTimeout,
GetCloseConnectionClosure(connection_id));
connection.on_security_key_request_callback = std::move(callback);
```
Done
auth_handler_->SetSendMessageCallback(base::NullCallback());Please fix this WARNING reported by autoreview issue finding: Please add `#include "base/functional/callback_helpers.h"` for `base::NullCallback()`.
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
remoting: Harden security key auth handlers and signaling transport
MAGI imposes these changes on the refactoring CL, so I figure I should
do it in a parent CL instead.
This CL adds robust null-safety and input-size validation to the
security key host-side components to prevent crashes and resource
exhaustion:
1. Mojo/Posix Auth Handlers: Removes the entry-point DCHECK and adds
runtime null checks for the send_message_callback_ to prevent host
crashes if a client disconnects during an active request.
2. Legacy Signaling: Enforces a strict 512KB pre-parsing limit on raw
JSON messages and a 64KB size limit on parsed payload byte lists to
prevent DoS/OOM on the JSON reader.
3. Unit Tests: Adds dedicated Mojo and Posix null-safety test cases.
TAG=agy CONV=a74bbced-b6c1-454e-adea-b8a5ad41a1ef
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |