| 1899 | |
| 1900 | |
| 1901 | bool wireEncryption(rem_port* port, ClumpletReader& id) |
| 1902 | { |
| 1903 | if (port->port_type == rem_port::XNET) // local connection |
| 1904 | { |
| 1905 | port->port_crypt_level = WIRECRYPT_DISABLED; |
| 1906 | return false; |
| 1907 | } |
| 1908 | |
| 1909 | int clientCrypt = id.find(CNCT_client_crypt) ? id.getInt() : WIRE_CRYPT_ENABLED; |
| 1910 | switch(clientCrypt) |
| 1911 | { |
| 1912 | case WIRE_CRYPT_REQUIRED: |
| 1913 | case WIRE_CRYPT_ENABLED: |
| 1914 | case WIRE_CRYPT_DISABLED: |
| 1915 | break; |
| 1916 | default: |
| 1917 | clientCrypt = WIRE_CRYPT_ENABLED; |
| 1918 | break; |
| 1919 | } |
| 1920 | |
| 1921 | int serverCrypt = port->getPortConfig()->getWireCrypt(WC_SERVER); |
| 1922 | if (wcCompatible[clientCrypt][serverCrypt] == WIRECRYPT_BROKEN) |
| 1923 | { |
| 1924 | Arg::Gds(isc_wirecrypt_incompatible).raise(); |
| 1925 | } |
| 1926 | |
| 1927 | port->port_crypt_level = wcCompatible[clientCrypt][serverCrypt]; |
| 1928 | return wcCompatible[clientCrypt][serverCrypt] >= WIRECRYPT_ENABLED; |
| 1929 | } |
| 1930 | |
| 1931 | |
| 1932 | class ConnectAuth : public ServerAuth |
no test coverage detected