Skip to content
Permalink
Browse files
8258631: Remove sun.security.jgss.krb5.Krb5Util.getSubject()
Reviewed-by: xuelei
  • Loading branch information
wangweij committed Dec 22, 2020
1 parent 0849117 commit 9e463d1a881e4ae0f5802acb856204c6f9f3ce6f
Showing 1 changed file with 1 addition and 25 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -100,30 +100,6 @@ static KerberosTicket getInitialTicket(GSSCaller caller,
return ticket;
}

/**
* Retrieves the caller's Subject, or Subject obtained by logging in
* via the specified caller.
*
* Caller must have permission to:
* - access the Subject
* - create LoginContext
* - read the auth.login.defaultCallbackHandler security property
*
* NOTE: This method is used by JSSE Kerberos Cipher Suites
*/
public static Subject getSubject(GSSCaller caller,
AccessControlContext acc) throws LoginException {

// Try to get the Subject from acc
Subject subject = Subject.getSubject(acc);

// Try to get Subject obtained from GSSUtil
if (subject == null && !GSSUtil.useSubjectCredsOnly(caller)) {
subject = GSSUtil.login(caller, GSSUtil.GSS_KRB5_MECH_OID);
}
return subject;
}

/**
* Retrieves the ServiceCreds for the specified server principal from
* the Subject in the specified AccessControlContext. If not found, and if

1 comment on commit 9e463d1

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 9e463d1 Dec 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.