diff options
Diffstat (limited to 'net/bluetooth/hci_conn.c')
| -rw-r--r-- | net/bluetooth/hci_conn.c | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 3cf0764d5793..15d1cb5aee18 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -1276,14 +1276,6 @@ int hci_conn_check_link_mode(struct hci_conn *conn)  	    !test_bit(HCI_CONN_ENCRYPT, &conn->flags))  		return 0; -	/* The minimum encryption key size needs to be enforced by the -	 * host stack before establishing any L2CAP connections. The -	 * specification in theory allows a minimum of 1, but to align -	 * BR/EDR and LE transports, a minimum of 7 is chosen. -	 */ -	if (conn->enc_key_size < HCI_MIN_ENC_KEY_SIZE) -		return 0; -  	return 1;  } @@ -1400,8 +1392,16 @@ auth:  		return 0;  encrypt: -	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags)) +	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags)) { +		/* Ensure that the encryption key size has been read, +		 * otherwise stall the upper layer responses. +		 */ +		if (!conn->enc_key_size) +			return 0; + +		/* Nothing else needed, all requirements are met */  		return 1; +	}  	hci_conn_encrypt(conn);  	return 0; |