Print this page
1575 untangle libmlrpc ... pre2:
 Get rid of ndr_rpc_server_{info,os}

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/smbsrv/libmlsvc/common/netr_auth.c
          +++ new/usr/src/lib/smbsrv/libmlsvc/common/netr_auth.c
↓ open down ↓ 183 lines elided ↑ open up ↑
 184  184                  return (-1);
 185  185          }
 186  186  
 187  187          (void) memcpy(&netr_info->server_challenge, &arg.server_challenge,
 188  188              sizeof (struct netr_credential));
 189  189  
 190  190          ndr_rpc_release(netr_handle);
 191  191          return (0);
 192  192  }
 193  193  
      194 +uint32_t netr_server_auth2_flags =
      195 +    NETR_NEGOTIATE_BASE_FLAGS |
      196 +    NETR_NEGOTIATE_STRONGKEY_FLAG;
      197 +
 194  198  /*
 195  199   * netr_server_authenticate2
 196  200   */
 197  201  static int
 198  202  netr_server_authenticate2(mlsvc_handle_t *netr_handle, netr_info_t *netr_info)
 199  203  {
 200  204          struct netr_ServerAuthenticate2 arg;
 201  205          /* sizeof netr_info->hostname, + 1 for the '$' */
 202  206          char account_name[(NETBIOS_NAME_SZ * 2) + 1];
 203  207          int opnum;
↓ open down ↓ 5 lines elided ↑ open up ↑
 209  213          (void) snprintf(account_name, sizeof (account_name), "%s$",
 210  214              netr_info->hostname);
 211  215  
 212  216          smb_tracef("server=[%s] account_name=[%s] hostname=[%s]\n",
 213  217              netr_info->server, account_name, netr_info->hostname);
 214  218  
 215  219          arg.servername = (unsigned char *)netr_info->server;
 216  220          arg.account_name = (unsigned char *)account_name;
 217  221          arg.account_type = NETR_WKSTA_TRUST_ACCOUNT_TYPE;
 218  222          arg.hostname = (unsigned char *)netr_info->hostname;
 219      -        arg.negotiate_flags = NETR_NEGOTIATE_BASE_FLAGS;
      223 +        arg.negotiate_flags = netr_server_auth2_flags;
 220  224  
 221      -        if (ndr_rpc_server_os(netr_handle) == NATIVE_OS_WIN2000) {
 222      -                arg.negotiate_flags |= NETR_NEGOTIATE_STRONGKEY_FLAG;
      225 +        if (arg.negotiate_flags & NETR_NEGOTIATE_STRONGKEY_FLAG) {
 223  226                  if (netr_gen_skey128(netr_info) != SMBAUTH_SUCCESS)
 224  227                          return (-1);
 225  228          } else {
 226  229                  if (netr_gen_skey64(netr_info) != SMBAUTH_SUCCESS)
 227  230                          return (-1);
 228  231          }
 229  232  
 230  233          if (netr_gen_credentials(netr_info->session_key.key,
 231  234              &netr_info->client_challenge, 0,
 232  235              &netr_info->client_credential) != SMBAUTH_SUCCESS) {
↓ open down ↓ 355 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX