Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/sun/net/www/protocol/http/NegotiatorImpl.java
          +++ new/src/share/classes/sun/net/www/protocol/http/spnego/NegotiatorImpl.java
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   *
  17   17   * You should have received a copy of the GNU General Public License version
  18   18   * 2 along with this work; if not, write to the Free Software Foundation,
  19   19   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20   20   *
  21   21   * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  22   22   * CA 95054 USA or visit www.sun.com if you need additional information or
  23   23   * have any questions.
  24   24   */
  25   25  
  26      -package sun.net.www.protocol.http;
       26 +package sun.net.www.protocol.http.spnego;
  27   27  
  28   28  import java.io.IOException;
  29   29  
  30   30  import org.ietf.jgss.GSSContext;
  31   31  import org.ietf.jgss.GSSException;
  32   32  import org.ietf.jgss.GSSName;
  33   33  import org.ietf.jgss.Oid;
  34   34  
       35 +import sun.net.www.protocol.http.HttpCallerInfo;
       36 +import sun.net.www.protocol.http.Negotiator;
  35   37  import sun.security.jgss.GSSManagerImpl;
  36   38  import sun.security.jgss.GSSUtil;
  37   39  import sun.security.jgss.HttpCaller;
  38   40  
  39   41  /**
  40   42   * This class encapsulates all JAAS and JGSS API calls in a separate class
  41   43   * outside NegotiateAuthentication.java so that J2SE build can go smoothly
  42   44   * without the presence of it.
  43   45   *
  44   46   * @author weijun.wang@sun.com
↓ open down ↓ 81 lines elided ↑ open up ↑
 126  128              IOException ioe = new IOException("Negotiate support not initiated");
 127  129              ioe.initCause(e);
 128  130              throw ioe;
 129  131          }
 130  132      }
 131  133  
 132  134      /**
 133  135       * Return the first token of GSS, in SPNEGO, it's called NegTokenInit
 134  136       * @return the first token
 135  137       */
      138 +    @Override
 136  139      public byte[] firstToken() {
 137  140          return oneToken;
 138  141      }
 139  142  
 140  143      /**
 141  144       * Return the rest tokens of GSS, in SPNEGO, it's called NegTokenTarg
 142  145       * @param token the token received from server
 143  146       * @return the next token
 144  147       * @throws java.io.IOException if the token cannot be created successfully
 145  148       */
      149 +    @Override
 146  150      public byte[] nextToken(byte[] token) throws IOException {
 147  151          try {
 148  152              return context.initSecContext(token, 0, token.length);
 149  153          } catch (GSSException e) {
 150  154              if (DEBUG) {
 151  155                  System.out.println("Negotiate support cannot continue. Reason:");
 152  156                  e.printStackTrace();
 153  157              }
 154  158              IOException ioe = new IOException("Negotiate support cannot continue");
 155  159              ioe.initCause(e);
 156  160              throw ioe;
 157  161          }
 158  162      }
 159  163  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX