src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java
changeset 58331 e4ce29f6094e
parent 52370 cb06c2248720
equal deleted inserted replaced
58330:de8e08015d51 58331:e4ce29f6094e
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    57     private static final int GSS_C_PROT_READY_FLAG = 128;
    57     private static final int GSS_C_PROT_READY_FLAG = 128;
    58     private static final int GSS_C_TRANS_FLAG = 256;
    58     private static final int GSS_C_TRANS_FLAG = 256;
    59 
    59 
    60     private static final int NUM_OF_INQUIRE_VALUES = 6;
    60     private static final int NUM_OF_INQUIRE_VALUES = 6;
    61 
    61 
       
    62     // Warning: The following 9 fields are used by NativeUtil.c
    62     private long pContext = 0; // Pointer to the gss_ctx_id_t structure
    63     private long pContext = 0; // Pointer to the gss_ctx_id_t structure
    63     private GSSNameElement srcName;
    64     private GSSNameElement srcName;
    64     private GSSNameElement targetName;
    65     private GSSNameElement targetName;
       
    66     private boolean isInitiator;
       
    67     private boolean isEstablished;
       
    68     private GSSCredElement delegatedCred;
       
    69     private int flags;
       
    70     private int lifetime = GSSCredential.DEFAULT_LIFETIME;
       
    71     private Oid actualMech; // Assigned during context establishment
       
    72 
    65     private GSSCredElement cred;
    73     private GSSCredElement cred;
    66     private GSSCredElement disposeCred;
    74     private GSSCredElement disposeCred;
    67     private boolean isInitiator;
       
    68     private boolean isEstablished;
       
    69     private Oid actualMech; // Assigned during context establishment
       
    70 
    75 
    71     private ChannelBinding cb;
    76     private ChannelBinding cb;
    72     private GSSCredElement delegatedCred;
       
    73     private GSSCredElement disposeDelegatedCred;
    77     private GSSCredElement disposeDelegatedCred;
    74     private int flags;
       
    75     private int lifetime = GSSCredential.DEFAULT_LIFETIME;
       
    76     private final GSSLibStub cStub;
    78     private final GSSLibStub cStub;
    77 
    79 
    78     private boolean skipDelegPermCheck;
    80     private boolean skipDelegPermCheck;
    79     private boolean skipServicePermCheck;
    81     private boolean skipServicePermCheck;
    80 
    82 
   229         // srcName and potentially targetName (when myCred is null)
   231         // srcName and potentially targetName (when myCred is null)
   230         // will be set in GSSLibStub.acceptContext(...)
   232         // will be set in GSSLibStub.acceptContext(...)
   231     }
   233     }
   232 
   234 
   233     // Constructor for imported context
   235     // Constructor for imported context
       
   236     // Warning: called by NativeUtil.c
   234     NativeGSSContext(long pCtxt, GSSLibStub stub) throws GSSException {
   237     NativeGSSContext(long pCtxt, GSSLibStub stub) throws GSSException {
   235         assert(pContext != 0);
   238         assert(pContext != 0);
   236         pContext = pCtxt;
   239         pContext = pCtxt;
   237         cStub = stub;
   240         cStub = stub;
   238 
   241