jdk/test/sun/security/krb5/auto/KDC.java
changeset 5617 1b0d8c3d6223
parent 4532 f39917c8cf46
child 5622 2a600d13659a
equal deleted inserted replaced
5616:6f3f39ddc2c2 5617:1b0d8c3d6223
     1 /*
     1 /*
     2  * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 2008-2010 Sun Microsystems, Inc.  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.
     7  * published by the Free Software Foundation.
   738 
   738 
   739             // Reflection: int[] eType = body.eType;
   739             // Reflection: int[] eType = body.eType;
   740             Field f = KDCReqBody.class.getDeclaredField("eType");
   740             Field f = KDCReqBody.class.getDeclaredField("eType");
   741             f.setAccessible(true);
   741             f.setAccessible(true);
   742             eTypes = (int[])f.get(body);
   742             eTypes = (int[])f.get(body);
       
   743             if (eTypes.length < 2) {
       
   744                 throw new KrbException(Krb5.KDC_ERR_ETYPE_NOSUPP);
       
   745             }
   743             int eType = eTypes[0];
   746             int eType = eTypes[0];
   744 
   747 
   745             EncryptionKey ckey = keyForUser(body.cname, eType, false);
   748             EncryptionKey ckey = keyForUser(body.cname, eType, false);
   746             EncryptionKey skey = keyForUser(body.sname, eType, true);
   749             EncryptionKey skey = keyForUser(body.sname, eType, true);
   747             if (ckey == null) {
   750             if (ckey == null) {