jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java
changeset 14340 e150cbaf584e
parent 10348 7d1a82029332
child 14342 8435a30053c1
equal deleted inserted replaced
14339:3b561cef789b 14340:e150cbaf584e
    97     private byte[] nonce;
    97     private byte[] nonce;
    98     private int step = 0;
    98     private int step = 0;
    99     private String authzId;
    99     private String authzId;
   100     private final String mech;
   100     private final String mech;
   101     private String hostname;
   101     private String hostname;
       
   102     private String target;
   102 
   103 
   103     /**
   104     /**
   104      * @param mech not null
   105      * @param mech not null
   105      * @param protocol not null for Sasl, ignored in NTLM
   106      * @param protocol not null for Sasl, ignored in NTLM
   106      * @param serverName not null for Sasl, can be null in NTLM. If non-null,
   107      * @param serverName not null for Sasl, can be null in NTLM. If non-null,
   178                 return server.type2(response, nonce);
   179                 return server.type2(response, nonce);
   179             } else {
   180             } else {
   180                 String[] out = server.verify(response, nonce);
   181                 String[] out = server.verify(response, nonce);
   181                 authzId = out[0];
   182                 authzId = out[0];
   182                 hostname = out[1];
   183                 hostname = out[1];
       
   184                 target = out[2];
   183                 return null;
   185                 return null;
   184             }
   186             }
   185         } catch (NTLMException ex) {
   187         } catch (NTLMException ex) {
   186             throw new SaslException("NTLM: generate response failure", ex);
   188             throw new SaslException("NTLM: generate response failure", ex);
   187         }
   189         }
   218             throw new IllegalStateException("authentication not complete");
   220             throw new IllegalStateException("authentication not complete");
   219         }
   221         }
   220         switch (propName) {
   222         switch (propName) {
   221             case Sasl.QOP:
   223             case Sasl.QOP:
   222                 return "auth";
   224                 return "auth";
       
   225             case Sasl.BOUND_SERVER_NAME:
       
   226                 return target;
   223             case NTLM_HOSTNAME:
   227             case NTLM_HOSTNAME:
   224                 return hostname;
   228                 return hostname;
   225             default:
   229             default:
   226                 return null;
   230                 return null;
   227         }
   231         }