@Override public boolean equals(Object obj) { if (!(obj instanceof BogusGSSCredential)) { return false; } GSSName otherName = ((BogusGSSCredential) obj).name; return name == null ? otherName == null : name.equals((Object) otherName); } }
/** * Performs identity authorization. The given identity is compared * with the peer's identity. * * @param context the security context * @param host host address of the peer. * @exception AuthorizationException if the peer's * identity does not match the expected identity. */ public void authorize(GSSContext context, String host) throws AuthorizationException { logger.debug("Authorization: IDENTITY"); try { GSSName expected = getExpectedName(null, host); GSSName target = null; if (context.isInitiator()) { target = context.getTargName(); } else { target = context.getSrcName(); } if (!expected.equals(target)) { generateAuthorizationException(expected, target); } } catch (GSSException e) { throw new AuthorizationException("Authorization failure", e); } }
/** * Performs identity authorization. The given identity is compared * with the peer's identity. * * @param context the security context * @param host host address of the peer. * @exception AuthorizationException if the peer's * identity does not match the expected identity. */ public void authorize(GSSContext context, String host) throws AuthorizationException { logger.debug("Authorization: IDENTITY"); try { GSSName expected = getExpectedName(null, host); GSSName target = null; if (context.isInitiator()) { target = context.getTargName(); } else { target = context.getSrcName(); } if (!expected.equals(target)) { generateAuthorizationException(expected, target); } } catch (GSSException e) { throw new AuthorizationException("Authorization failure", e); } }
/** * Performs host authorization. If that fails, performs self authorization */ public void authorize(GSSContext context, String host) throws AuthorizationException { logger.debug("Authorization: HOST/SELF"); try { GSSName expected = this.hostAuthz.getExpectedName(null, host); GSSName target = null; if (context.isInitiator()) { target = context.getTargName(); } else { target = context.getSrcName(); } if (!expected.equals(target)) { logger.debug("Host authorization failed. Expected " + expected + " target is " + target); if (!context.getSrcName().equals(context.getTargName())) { if (context.isInitiator()) { expected = context.getSrcName(); } else { expected = context.getTargName(); } generateAuthorizationException(expected, target); } } } catch (GSSException e) { throw new AuthorizationException("Authorization failure", e); } }
/** * Performs host authorization. If that fails, performs self authorization */ public void authorize(GSSContext context, String host) throws AuthorizationException { logger.debug("Authorization: HOST/SELF"); try { GSSName expected = this.hostAuthz.getExpectedName(null, host); GSSName target = null; if (context.isInitiator()) { target = context.getTargName(); } else { target = context.getSrcName(); } if (!expected.equals(target)) { logger.debug("Host authorization failed. Expected " + expected + " target is " + target); if (!context.getSrcName().equals(context.getTargName())) { if (context.isInitiator()) { expected = context.getSrcName(); } else { expected = context.getTargName(); } generateAuthorizationException(expected, target); } } } catch (GSSException e) { throw new AuthorizationException("Authorization failure", e); } }
/** * Performs host authentication. The hostname of the peer is * compared with the hostname specified in the peer's (topmost) * certificate in the certificate chain. The hostnames must * match exactly (in case-insensitive way) * * @param context the security context * @param host host address of the peer. * @exception AuthorizationException if the hostnames * do not match. */ public void authorize(GSSContext context, String host) throws AuthorizationException { logger.debug("Authorization: HOST"); try { GSSName expected = getExpectedName(null, host); GSSName target = null; if (context.isInitiator()) { target = context.getTargName(); } else { target = context.getSrcName(); } if (!expected.equals(target)) { generateAuthorizationException(expected, target); } } catch (GSSException e) { throw new AuthorizationException("Authorization failure", e); } }
/** * Performs host authentication. The hostname of the peer is * compared with the hostname specified in the peer's (topmost) * certificate in the certificate chain. The hostnames must * match exactly (in case-insensitive way) * * @param context the security context * @param host host address of the peer. * @exception AuthorizationException if the hostnames * do not match. */ public void authorize(GSSContext context, String host) throws AuthorizationException { logger.debug("Authorization: HOST"); try { GSSName expected = getExpectedName(null, host); GSSName target = null; if (context.isInitiator()) { target = context.getTargName(); } else { target = context.getSrcName(); } if (!expected.equals(target)) { generateAuthorizationException(expected, target); } } catch (GSSException e) { throw new AuthorizationException("Authorization failure", e); } }
!this.expectedTargetName.equals(this.targetName)) { throw new GlobusGSSException(GSSException.UNAUTHORIZED, GlobusGSSException.BAD_NAME,
!this.expectedTargetName.equals(this.targetName)) { throw new GlobusGSSException(GSSException.UNAUTHORIZED, GlobusGSSException.BAD_NAME,
/** * Performs self authorization. */ public void authorize(GSSContext context, String host) throws AuthorizationException { logger.debug("Authorization: SELF"); try { if (!context.getSrcName().equals(context.getTargName())) { GSSName expected = null; GSSName target = null; if (context.isInitiator()) { expected = context.getSrcName(); target = context.getTargName(); } else { expected = context.getTargName(); target = context.getSrcName(); } generateAuthorizationException(expected, target); } } catch (GSSException e) { throw new AuthorizationException("Authorization failure", e); } }
/** * Performs self authorization. */ public void authorize(GSSContext context, String host) throws AuthorizationException { logger.debug("Authorization: SELF"); try { if (!context.getSrcName().equals(context.getTargName())) { GSSName expected = null; GSSName target = null; if (context.isInitiator()) { expected = context.getSrcName(); target = context.getTargName(); } else { expected = context.getTargName(); target = context.getSrcName(); } generateAuthorizationException(expected, target); } } catch (GSSException e) { throw new AuthorizationException("Authorization failure", e); } }