/** * Check encryption type. * * @throws org.apache.kerby.kerberos.kerb.KrbException e */ protected void checkEncryptionType() throws KrbException { List<EncryptionType> requestedTypes = getKdcReq().getReqBody().getEtypes(); EncryptionType bestType = EncryptionUtil.getBestEncryptionType(requestedTypes, kdcContext.getConfig().getEncryptionTypes()); if (bestType == null) { LOG.error("Can't get the best encryption type."); throw new KrbException(KrbErrorCode.KDC_ERR_ETYPE_NOSUPP); } setEncryptionType(bestType); }
/** * Check encryption type. * * @throws org.apache.kerby.kerberos.kerb.KrbException e */ protected void checkEncryptionType() throws KrbException { List<EncryptionType> requestedTypes = getKdcReq().getReqBody().getEtypes(); EncryptionType bestType = EncryptionUtil.getBestEncryptionType(requestedTypes, kdcContext.getConfig().getEncryptionTypes()); if (bestType == null) { LOG.error("Can't get the best encryption type."); throw new KrbException(KrbErrorCode.KDC_ERR_ETYPE_NOSUPP); } setEncryptionType(bestType); }
/** * Check server. * * @throws org.apache.kerby.kerberos.kerb.KrbException e */ private void checkServer() throws KrbException { KdcReq request = getKdcReq(); PrincipalName principal = request.getReqBody().getSname(); String serverRealm = request.getReqBody().getRealm(); if (serverRealm == null || serverRealm.isEmpty()) { LOG.info("Can't get the server realm from request, and try to get from kdcContext."); serverRealm = kdcContext.getKdcRealm(); } principal.setRealm(serverRealm); KrbIdentity serverEntry = getEntry(principal.getName()); if (serverEntry == null) { LOG.error("Principal: " + principal.getName() + " is not known"); throw new KrbException(KrbErrorCode.KDC_ERR_S_PRINCIPAL_UNKNOWN); } setServerEntry(serverEntry); for (EncryptionType encType : request.getReqBody().getEtypes()) { if (serverEntry.getKeys().containsKey(encType)) { EncryptionKey serverKey = serverEntry.getKeys().get(encType); setServerKey(serverKey); break; } } }
/** * Check server. * * @throws org.apache.kerby.kerberos.kerb.KrbException e */ private void checkServer() throws KrbException { KdcReq request = getKdcReq(); PrincipalName principal = request.getReqBody().getSname(); String serverRealm = request.getReqBody().getRealm(); if (serverRealm == null || serverRealm.isEmpty()) { LOG.info("Can't get the server realm from request, and try to get from kdcContext."); serverRealm = kdcContext.getKdcRealm(); } principal.setRealm(serverRealm); KrbIdentity serverEntry = getEntry(principal.getName()); if (serverEntry == null) { LOG.error("Principal: " + principal.getName() + " is not known"); throw new KrbException(KrbErrorCode.KDC_ERR_S_PRINCIPAL_UNKNOWN); } setServerEntry(serverEntry); for (EncryptionType encType : request.getReqBody().getEtypes()) { if (serverEntry.getKeys().containsKey(encType)) { EncryptionKey serverKey = serverEntry.getKeys().get(encType); setServerKey(serverKey); break; } } }
for (EncryptionType encType : request.getReqBody().getEtypes()) { if (clientEntry.getKeys().containsKey(encType)) { EncryptionKey clientKey = clientEntry.getKeys().get(encType);
for (EncryptionType encType : request.getReqBody().getEtypes()) { if (clientEntry.getKeys().containsKey(encType)) { EncryptionKey clientKey = clientEntry.getKeys().get(encType);
throws KrbException { List<EncryptionType> encryptionTypes = kdcContext.getConfig().getEncryptionTypes(); List<EncryptionType> clientEtypes = request.getReqBody().getEtypes(); boolean isNewEtype = true;
throws KrbException { List<EncryptionType> encryptionTypes = kdcContext.getConfig().getEncryptionTypes(); List<EncryptionType> clientEtypes = request.getReqBody().getEtypes(); boolean isNewEtype = true;