Any aa;
try {
aa = codec.decode_value(name, OctetSeqHelper.type());
}
catch (UserException e) {
MARSHAL me = new MARSHAL("cannot decode security descriptor",
0, CompletionStatus.COMPLETED_NO);
me.initCause(e);
throw me;
}
byte[] exported_name = OctetSeqHelper.extract(aa);
// byte[] exported_name = uncapsulateByteArray(name);
String userAtDomain = decodeGSSExportedName(exported_name);
log.fine("establish ITTPrincipalName " + userAtDomain);
int idx = userAtDomain.indexOf('@');
String user = "";
String domain;
if (idx == -1) {
user = userAtDomain;
domain = "default";
} else {
user = userAtDomain.substring(0, idx);
domain = userAtDomain.substring(idx + 1);
}
if (gssup_domain != null && !domain.equals(gssup_domain)) {
returnContextError(ri, 1, 1);
log.warning("request designates wrong domain: " + userAtDomain);
throw new org.omg.CORBA.NO_PERMISSION("bad domain");
}
// CSISubjectInfo.setPropagatedCaller (user, domain);
Subject subject = SecurityContext.delegate(user, domain);
SecurityContext.setAuthenticatedSubject(subject);
returnCompleteEstablishContext(ri);
} else if (establishMsg.identity_token.discriminator() == ITTAnonymous.value) {
// establish anoynous identity
log.fine("accepting ITTAnonymous");
// CSISubjectInfo.setAnonymousSubject ();
try {
Subject subject = SecurityContext.anonymousLogin();
SecurityContext.setAuthenticatedSubject(subject);
}
catch (LoginException ex) {
// Won't happen
}
returnCompleteEstablishContext(ri);
} else if (establishMsg.identity_token.discriminator() == ITTDistinguishedName.value) {
log.fine("accepting ITTDistinguishedName");
byte[] name_data = establishMsg.identity_token.dn();
Any aa;
try {
aa = codec.decode_value(name_data, OctetSeqHelper.type());
}
catch (UserException e) {
MARSHAL me = new MARSHAL("cannot encode security descriptor",
0, CompletionStatus.COMPLETED_NO);
me.initCause(e);
throw me;
}
byte[] x500name_data = OctetSeqHelper.extract(aa);
// byte[] x500name_data = uncapsulateByteArray(name_data);