directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r578743 [1/12] - in /directory/apacheds/branches/apacheds-kerberos: kerberos-shared/ kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/ kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto...
Date Mon, 24 Sep 2007 10:18:45 GMT
Author: elecharny
Date: Mon Sep 24 03:18:05 2007
New Revision: 578743

URL: http://svn.apache.org/viewvc?rev=578743&view=rev
Log:
Applied the changes I have made on the kerberos code to a branch, in order to share this work with others.

Be aware that it's not compiling yet...

Added:
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/KerberosUtils.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/AuthServerReply.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/AuthServerRequest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/KerberosCred.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/KerberosError.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/KerberosPriv.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/TicketGrantingServerRequest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/application/ApplicationRequest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/InvalidTicketException.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AdAndOr.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/KerberosRequestBody.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PreAuthEncryptedTimestamp.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/ApOption.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/ApOptions.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/KdcOption.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/KdcOptions.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/KerberosFlag.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/KerberosFlags.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/Options.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlag.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlags.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/AuthorizationType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/HostAddressType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/KerberosErrorType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/LastRequestType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/PreAuthenticationDataType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/PrincipalNameType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/SamType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/TransitedEncodingType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/service/VerifyTicket.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/checksum/
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/checksum/KerberosUtilsTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/AuthServerRequestTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/KdcRequestTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/KerberosCredTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/KerberosErrorTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/KerberosPrivTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/TicketGrantingServerRequestTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/AuthenticatorTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AdAndOrTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionTypeInfo2EntryTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionTypeInfoEntryTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressesTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KerberosRequestBodyTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KerberosTimeTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PreAuthEncryptedTimestampTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PreAuthenticationDataTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncodingTest.java
Removed:
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/exceptions/ErrorType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/EncryptionTypeInfo2Decoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/EncryptionTypeInfoDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncryptionTypeInfo2Encoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/ApplicationRequest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/AuthenticationReply.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/ErrorMessage.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/ErrorMessageModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/AuthenticatorModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncKrbPrivPartModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncTicketPartModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/ApOptions.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedTimeStamp.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptions.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/LastRequestType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Options.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PreAuthenticationDataModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PreAuthenticationDataType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/RequestBody.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/RequestBodyModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/SamType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/TicketFlags.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncodingType.java
Modified:
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/pom.xml
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumEngine.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumHandler.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/Crc32Checksum.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesCtsSha1Encryption.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/ArcFourHmacMd5Encryption.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandler.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryption.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryption.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/EncryptionType.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactory.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/exceptions/KerberosException.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/ApplicationRequestDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/AuthenticatorDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/AuthorizationDataDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/EncKdcRepPartDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/EncKrbPrivPartDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/EncTicketPartDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/EncryptedDataDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/EncryptedTimestampDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/EncryptionTypeDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/ErrorMessageDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/HostAddressDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/KdcReplyDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/KdcRequestDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/LastRequestDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/PreAuthenticationDataDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/PrincipalNameDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/TicketDecoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/ApplicationRequestEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/AuthenticatorEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncKdcRepPartEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncKrbPrivPartEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncTicketPartEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncryptedDataEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncryptedTimestampEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncryptionTypeEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/ErrorMessageEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/KdcReplyEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/KdcRequestEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/PrincipalNameEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/TicketEncoder.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/KdcReply.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/KdcRequest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/KerberosMessage.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/TicketGrantReply.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/Authenticator.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncAsRepPart.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncKdcRepPart.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncKrbPrivPart.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncTgsRepPart.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncTicketPart.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/Ticket.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/TicketModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationData.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataEntry.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedData.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedTimeStampModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKey.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionTypeInfoEntry.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddress.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddresses.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/KerberosPrincipalModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/KerberosTime.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/KrbCredInfo.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/LastRequest.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/LastRequestEntry.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PreAuthenticationData.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalName.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncoding.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/package-info.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/service/GetPrincipalStoreEntry.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/service/VerifyAuthHeader.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStore.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/TicketFactory.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetAllPrincipals.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
    directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordConfiguration.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordDataEncoder.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorEncoder.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordRequestDecoder.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordRequestEncoder.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordError.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordErrorModifier.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequest.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequestModifier.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordProtocolHandler.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/BuildReply.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/ChangePasswordContext.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetAuthHeader.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetServerEntry.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorContext.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicket.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicketAuthHeader.java
    directory/apacheds/branches/apacheds-kerberos/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcConfiguration.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorReply.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorRequest.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/SelectEncryptionType.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/BuildReply.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/GenerateTicket.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/GetClientEntry.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/GetServerEntry.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/SealReply.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/VerifyPolicy.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/preauthentication/VerifierBase.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/preauthentication/VerifyEncryptedTimestamp.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/preauthentication/VerifySam.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/BuildReply.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/GenerateTicket.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/GetAuthHeader.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/GetRequestPrincipalEntry.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/GetTicketPrincipalEntry.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/MonitorContext.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingContext.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/VerifyTgtAuthHeader.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/sam/SamException.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/sam/SamSubsystem.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/sam/SamVerifier.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/sam/TimestampChecker.java
    directory/apacheds/branches/apacheds-kerberos/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/pom.xml?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/pom.xml (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/pom.xml Mon Sep 24 03:18:05 2007
@@ -43,6 +43,12 @@
       <artifactId>apacheds-protocol-shared</artifactId>
       <version>${pom.version}</version>
     </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>nlog4j</artifactId>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 </project>
 

Added: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/KerberosUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/KerberosUtils.java?rev=578743&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/KerberosUtils.java (added)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/KerberosUtils.java Mon Sep 24 03:18:05 2007
@@ -0,0 +1,200 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.kerberos.shared;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+import org.apache.directory.shared.ldap.util.StringTools;
+
+/**
+ * An utility class for Kerberos.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class KerberosUtils
+{
+    /** A constant for integer optional values */
+    public static final int NULL = -1;
+
+    private static final List<String> EMPTY_PRINCIPAL_NAME = new ArrayList<String>();
+    
+    /**
+     * Parse a KerberosPrincipal instance and return the names. The Principal name
+     * is described in RFC 1964 : <br/>
+     * <br/>
+     * This name type corresponds to the single-string representation of a<br/>
+     * Kerberos name.  (Within the MIT Kerberos V5 implementation, such<br/>
+     * names are parseable with the krb5_parse_name() function.)  The<br/>
+     * elements included within this name representation are as follows,<br/>
+     * proceeding from the beginning of the string:<br/>
+     * <br/>
+     *  (1) One or more principal name components; if more than one<br/>
+     *  principal name component is included, the components are<br/>
+     *  separated by `/`.  Arbitrary octets may be included within<br/>
+     *  principal name components, with the following constraints and<br/>
+     *  special considerations:<br/>
+     * <br/>
+     *     (1a) Any occurrence of the characters `@` or `/` within a<br/>
+     *     name component must be immediately preceded by the `\`<br/>
+     *     quoting character, to prevent interpretation as a component<br/>
+     *     or realm separator.<br/>
+     * <br/>
+     *     (1b) The ASCII newline, tab, backspace, and null characters<br/>
+     *     may occur directly within the component or may be<br/>
+     *     represented, respectively, by `\n`, `\t`, `\b`, or `\0`.<br/>
+     * <br/>
+     *     (1c) If the `\` quoting character occurs outside the contexts<br/>
+     *     described in (1a) and (1b) above, the following character is<br/>
+     *     interpreted literally.  As a special case, this allows the<br/>
+     *     doubled representation `\\` to represent a single occurrence<br/>
+     *     of the quoting character.<br/>
+     * <br/>
+     *     (1d) An occurrence of the `\` quoting character as the last<br/>
+     *     character of a component is illegal.<br/>
+     * <br/>
+     *  (2) Optionally, a `@` character, signifying that a realm name<br/>
+     *  immediately follows. If no realm name element is included, the<br/>
+     *  local realm name is assumed.  The `/` , `:`, and null characters<br/>
+     *  may not occur within a realm name; the `@`, newline, tab, and<br/>
+     *  backspace characters may be included using the quoting<br/>
+     *  conventions described in (1a), (1b), and (1c) above.<br/>
+     * 
+     * @param principal The principal to be parsed
+     * @return The names as a List of nameComponent
+     * 
+     * @throws ParseException if the name is not valid
+     */
+    public static List<String> getNames( KerberosPrincipal principal ) throws ParseException
+    {
+        if ( principal == null )
+        {
+            return EMPTY_PRINCIPAL_NAME;
+        }
+        
+        String names = principal.getName();
+        
+        if ( StringTools.isEmpty( names ) )
+        {
+            // Empty name...
+            return EMPTY_PRINCIPAL_NAME;
+        }
+        
+        return getNames( names );
+    }
+
+    /**
+     * Parse a PrincipalName and return the names.
+     * 
+     */
+    public static List<String> getNames( String principalNames ) throws ParseException
+    {
+        if ( principalNames == null )
+        {
+            return EMPTY_PRINCIPAL_NAME;
+        }
+        
+        List<String> nameComponents = new ArrayList<String>();
+        
+        // Start the parsing. Another State Machine :)
+        char[] chars = principalNames.toCharArray();
+        
+        boolean escaped = false;
+        boolean done = false;
+        int start = 0;
+        int pos = 0;
+        
+        for ( int i = 0; i < chars.length; i++ )
+        {
+            pos = i;
+            
+            switch ( chars[i] )
+            {
+                case '\\' :
+                    escaped = !escaped;
+                    break;
+                    
+                case '/'  :
+                    if ( escaped )
+                    {
+                        escaped = false;
+                    }
+                    else 
+                    {
+                        // We have a new name component
+                        if ( i - start > 0 )
+                        {
+                            String nameComponent = new String( chars, start, i - start );
+                            nameComponents.add( nameComponent );
+                            start = i + 1;
+                        }
+                        else
+                        {
+                            throw new ParseException( "An empty name is not valid in a kerberos name", i );
+                        }
+                    }
+                    
+                    break;
+                    
+                case '@'  :
+                    if ( escaped )
+                    {
+                        escaped = false;
+                    }
+                    else
+                    {
+                        // We have reached the realm : let's get out
+                        done = true;
+                        // We have a new name component
+
+                        if ( i - start > 0 )
+                        {
+                            String nameComponent = new String( chars, start, i - start );
+                            nameComponents.add( nameComponent );
+                            start = i + 1;
+                        }
+                        else
+                        {
+                            throw new ParseException( "An empty name is not valid in a kerberos name", i );
+                        }
+                    }
+                    
+                    break;
+                    
+                default :
+            }
+            
+            if ( done )
+            {
+                break;
+            }
+        } 
+        
+        if ( escaped )
+        {
+            throw new ParseException( "A '/' at the end of a Kerberos Name is not valid.", pos );
+        }
+        
+        return nameComponents;
+    }
+}

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumEngine.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumEngine.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumEngine.java Mon Sep 24 03:18:05 2007
@@ -40,9 +40,10 @@
     /**
      * Calculate a checksum given raw bytes and an (optional) key.
      *
-     * @param data
-     * @param key
-     * @param usage 
+     * @param data The data to encrypt
+     * @param key The key to use
+     * @param usage ???
+     * 
      * @return The checksum value.
      */
     public byte[] calculateChecksum( byte[] data, byte[] key, KeyUsage usage );

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumHandler.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumHandler.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumHandler.java Mon Sep 24 03:18:05 2007
@@ -28,9 +28,9 @@
 import org.apache.directory.server.kerberos.shared.crypto.encryption.Aes256CtsSha1Encryption;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.Des3CbcSha1KdEncryption;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.KeyUsage;
-import org.apache.directory.server.kerberos.shared.exceptions.ErrorType;
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.value.Checksum;
+import org.apache.directory.server.kerberos.shared.messages.value.types.KerberosErrorType;
 
 
 /**
@@ -73,7 +73,7 @@
     {
         if ( !DEFAULT_CHECKSUMS.containsKey( checksumType ) )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_SUMTYPE_NOSUPP );
+            throw new KerberosException( KerberosErrorType.KDC_ERR_SUMTYPE_NOSUPP );
         }
 
         ChecksumEngine digester = getEngine( checksumType );
@@ -94,12 +94,12 @@
     {
         if ( checksum == null )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_INAPP_CKSUM );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_INAPP_CKSUM );
         }
 
         if ( !DEFAULT_CHECKSUMS.containsKey( checksum.getChecksumType() ) )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_SUMTYPE_NOSUPP );
+            throw new KerberosException( KerberosErrorType.KDC_ERR_SUMTYPE_NOSUPP );
         }
 
         ChecksumType checksumType = checksum.getChecksumType();
@@ -108,7 +108,7 @@
 
         if ( !newChecksum.equals( checksum ) )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_MODIFIED );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_MODIFIED );
         }
     }
 
@@ -119,7 +119,7 @@
 
         if ( clazz == null )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_SUMTYPE_NOSUPP );
+            throw new KerberosException( KerberosErrorType.KDC_ERR_SUMTYPE_NOSUPP );
         }
 
         try
@@ -128,11 +128,11 @@
         }
         catch ( IllegalAccessException iae )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_SUMTYPE_NOSUPP, iae );
+            throw new KerberosException( KerberosErrorType.KDC_ERR_SUMTYPE_NOSUPP, iae );
         }
         catch ( InstantiationException ie )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_SUMTYPE_NOSUPP, ie );
+            throw new KerberosException( KerberosErrorType.KDC_ERR_SUMTYPE_NOSUPP, ie );
         }
     }
 }

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java Mon Sep 24 03:18:05 2007
@@ -31,97 +31,97 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public final class ChecksumType implements Comparable<ChecksumType>
+public enum ChecksumType implements Comparable<ChecksumType>
 {
     /**
      * The "unknown" checksum type.
      */
-    public static final ChecksumType UNKNOWN = new ChecksumType( -1, "UNKNOWN" );
+    UNKNOWN( -1 ),
 
     /**
      * The "null" checksum type.
      */
-    public static final ChecksumType NULL = new ChecksumType( 0, "NULL" );
+    NULL( 0 ),
 
     /**
      * The CRC32 checksum type.
      */
-    public static final ChecksumType CRC32 = new ChecksumType( 1, "CRC32" );
+    CRC32( 1 ),
 
     /**
      * The rsa-md4 checksum type.
      */
-    public static final ChecksumType RSA_MD4 = new ChecksumType( 2, "rsa-md4" );
+    RSA_MD4( 2 ),
 
     /**
      * The rsa-md4-des checksum type.
      */
-    public static final ChecksumType RSA_MD4_DES = new ChecksumType( 3, "rsa-md4-des" );
+    RSA_MD4_DES( 3 ),
 
     /**
      * The des-mac checksum type.
      */
-    public static final ChecksumType DES_MAC = new ChecksumType( 4, "des-mac" );
+    DES_MAC( 4 ),
 
     /**
      * The des-mac-k checksum type.
      */
-    public static final ChecksumType DES_MAC_K = new ChecksumType( 5, "des-mac-k" );
+    DES_MAC_K( 5 ),
 
     /**
      * The rsa-md4-des-k checksum type.
      */
-    public static final ChecksumType RSA_MD4_DES_K = new ChecksumType( 6, "rsa-md4-des-k" );
+    RSA_MD4_DES_K( 6 ),
 
     /**
      * The rsa-md5 checksum type.
      */
-    public static final ChecksumType RSA_MD5 = new ChecksumType( 7, "rsa-md5" );
+    RSA_MD5( 7 ),
 
     /**
      * The rsa-md5-des checksum type.
      */
-    public static final ChecksumType RSA_MD5_DES = new ChecksumType( 8, "rsa-md5-des" );
+    RSA_MD5_DES( 8 ),
 
     /**
      * The rsa-md5-des3 checksum type.
      */
-    public static final ChecksumType RSA_MD5_DES3 = new ChecksumType( 9, "rsa-md5-des3" );
+    RSA_MD5_DES3( 9 ),
 
     /**
      * The sha1 (unkeyed) checksum type.
      */
-    public static final ChecksumType SHA1 = new ChecksumType( 10, "sha1 (unkeyed)" );
+    SHA1( 10 ),
 
     /**
      * The hmac-sha1-des3-kd checksum type.
      */
-    public static final ChecksumType HMAC_SHA1_DES3_KD = new ChecksumType( 12, "hmac-sha1-des3-kd" );
+    HMAC_SHA1_DES3_KD( 12 ),
 
     /**
      * The hmac-sha1-des3 checksum type.
      */
-    public static final ChecksumType HMAC_SHA1_DES3 = new ChecksumType( 13, "hmac-sha1-des3" );
+    HMAC_SHA1_DES3( 13 ),
 
     /**
      * The sha1 (unkeyed) checksum type.
      */
-    public static final ChecksumType SHA1_2 = new ChecksumType( 14, "sha1 (unkeyed)" );
+    SHA1_2 ( 14 ),
 
     /**
      * The hmac-sha1-96-aes128 checksum type.
      */
-    public static final ChecksumType HMAC_SHA1_96_AES128 = new ChecksumType( 15, "hmac-sha1-96-aes128" );
+    HMAC_SHA1_96_AES128( 15 ),
 
     /**
      * The hmac-sha1-96-aes256 checksum type.
      */
-    public static final ChecksumType HMAC_SHA1_96_AES256 = new ChecksumType( 16, "hmac-sha1-96-aes256" );
+    HMAC_SHA1_96_AES256( 16 ),
 
     /**
      * The hmac-md5 checksum type.
      */
-    public static final ChecksumType HMAC_MD5 = new ChecksumType( -138, "hmac-md5" );
+    HMAC_MD5( -138 );
 
     /**
      * Array for building a List of VALUES.
@@ -134,12 +134,7 @@
     /**
      * A List of all the checksum type constants.
      */
-    public static final List<ChecksumType> VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
-
-    /**
-     * The name of the checksum type.
-     */
-    private final String name;
+    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
 
     /**
      * The value/code for the checksum type.
@@ -150,10 +145,9 @@
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private ChecksumType( int ordinal, String name )
+    private ChecksumType( int ordinal )
     {
         this.ordinal = ordinal;
-        this.name = name;
     }
 
 
@@ -165,15 +159,28 @@
      */
     public static ChecksumType getTypeByOrdinal( int type )
     {
-        for ( int ii = 0; ii < values.length; ii++ )
-        {
-            if ( values[ii].ordinal == type )
-            {
-                return values[ii];
-            }
-        }
-
-        return UNKNOWN;
+    	switch ( type )
+    	{
+    		case -1	: return UNKNOWN;
+    		case 0	: return NULL;
+    		case 1	: return CRC32;
+    		case 2	: return RSA_MD4;
+    		case 3	: return RSA_MD4_DES;
+    		case 4	: return DES_MAC;
+    		case 5	: return DES_MAC_K;
+    		case 6	: return RSA_MD4_DES_K;
+    		case 7	: return RSA_MD5;
+    		case 8	: return RSA_MD5_DES;
+    		case 9	: return RSA_MD5_DES3;
+    		case 10	: return SHA1;
+    		case 12	: return HMAC_SHA1_DES3_KD;
+    		case 13	: return HMAC_SHA1_DES3;
+    		case 14	: return SHA1_2;
+    		case 15	: return HMAC_SHA1_96_AES128;
+    		case 16	: return HMAC_SHA1_96_AES256;
+    		case -138 : return HMAC_MD5;
+    		default	: return UNKNOWN;
+    	}
     }
 
 
@@ -185,17 +192,5 @@
     public int getOrdinal()
     {
         return ordinal;
-    }
-
-
-    public int compareTo( ChecksumType that )
-    {
-        return ordinal - that.ordinal;
-    }
-
-
-    public String toString()
-    {
-        return name;
     }
 }

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/Crc32Checksum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/Crc32Checksum.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/Crc32Checksum.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/Crc32Checksum.java Mon Sep 24 03:18:05 2007
@@ -27,36 +27,43 @@
 
 
 /**
+ * Compute a checksum using a CRC32 algorithm
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
 class Crc32Checksum implements ChecksumEngine
 {
+    /**
+     * Return the checksum type. Here, CRC32.
+     */
     public ChecksumType checksumType()
     {
         return ChecksumType.CRC32;
     }
 
-
+    /**
+     * Compute the checksum
+     * 
+     * @param data the data for which the checksum is computed
+     * @param key Not used
+     * @param usage Not used
+     * 
+     * @return the data checksum, as a four bytes array.
+     */
     public byte[] calculateChecksum( byte[] data, byte[] key, KeyUsage usage )
     {
         CRC32 crc32 = new CRC32();
         crc32.update( data );
+        int value = ( int ) crc32.getValue();
 
-        return int2octet( ( int ) crc32.getValue() );
-    }
-
-
-    private byte[] int2octet( int value )
-    {
         byte[] bytes = new byte[4];
-        int i, shift;
-
-        for ( i = 0, shift = 24; i < 4; i++, shift -= 8 )
-        {
-            bytes[i] = ( byte ) ( 0xFF & ( value >> shift ) );
-        }
-
+        
+        bytes[0] = ( byte ) ( ( value >> 24 ) & 0x00FF );
+        bytes[1] = ( byte ) ( ( value >> 16 ) & 0x00FF );
+        bytes[2] = ( byte ) ( ( value >> 8 ) & 0x00FF );
+        bytes[3] = ( byte ) ( value & 0x00FF );
+        
         return bytes;
     }
-}
+}
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesCtsSha1Encryption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesCtsSha1Encryption.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesCtsSha1Encryption.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesCtsSha1Encryption.java Mon Sep 24 03:18:05 2007
@@ -31,10 +31,10 @@
 import javax.crypto.spec.SecretKeySpec;
 
 import org.apache.directory.server.kerberos.shared.crypto.checksum.ChecksumEngine;
-import org.apache.directory.server.kerberos.shared.exceptions.ErrorType;
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.apache.directory.server.kerberos.shared.messages.value.types.KerberosErrorType;
 
 
 /**
@@ -44,9 +44,12 @@
 abstract class AesCtsSha1Encryption extends EncryptionEngine implements ChecksumEngine
 {
     private static final byte[] iv = new byte[]
-        { ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,
-            ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,
-            ( byte ) 0x00, ( byte ) 0x00 };
+        { 
+            ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, 
+            ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, 
+            ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, 
+            ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00 
+        };
 
 
     public int getConfounderLength()
@@ -86,7 +89,7 @@
     {
         byte[] Ke = deriveKey( key.getKeyValue(), getUsageKe( usage ), 128, getKeyLength() );
 
-        byte[] encryptedData = data.getCipherText();
+        byte[] encryptedData = data.getCipher();
 
         // extract the old checksum
         byte[] oldChecksum = new byte[getChecksumLength()];
@@ -108,7 +111,7 @@
         // compare checksums
         if ( !Arrays.equals( oldChecksum, newChecksum ) )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_BAD_INTEGRITY );
         }
 
         return withoutConfounder;

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/ArcFourHmacMd5Encryption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/ArcFourHmacMd5Encryption.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/ArcFourHmacMd5Encryption.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/ArcFourHmacMd5Encryption.java Mon Sep 24 03:18:05 2007
@@ -1,22 +1,3 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
 package org.apache.directory.server.kerberos.shared.crypto.encryption;
 
 
@@ -59,7 +40,7 @@
 
     public byte[] getDecryptedData( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException
     {
-        return data.getCipherText();
+        return data.getCipher();
     }
 
 

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandler.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandler.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandler.java Mon Sep 24 03:18:05 2007
@@ -26,7 +26,6 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.directory.server.kerberos.shared.exceptions.ErrorType;
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.io.decoder.AuthenticatorDecoder;
 import org.apache.directory.server.kerberos.shared.io.decoder.AuthorizationDataDecoder;
@@ -46,7 +45,7 @@
 import org.apache.directory.server.kerberos.shared.io.encoder.Encoder;
 import org.apache.directory.server.kerberos.shared.io.encoder.EncoderFactory;
 import org.apache.directory.server.kerberos.shared.io.encoder.EncryptedTimestampEncoder;
-import org.apache.directory.server.kerberos.shared.messages.AuthenticationReply;
+import org.apache.directory.server.kerberos.shared.messages.AuthServerReply;
 import org.apache.directory.server.kerberos.shared.messages.Encodable;
 import org.apache.directory.server.kerberos.shared.messages.TicketGrantReply;
 import org.apache.directory.server.kerberos.shared.messages.components.Authenticator;
@@ -56,8 +55,9 @@
 import org.apache.directory.server.kerberos.shared.messages.components.EncTicketPart;
 import org.apache.directory.server.kerberos.shared.messages.value.AuthorizationData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
-import org.apache.directory.server.kerberos.shared.messages.value.EncryptedTimeStamp;
+import org.apache.directory.server.kerberos.shared.messages.value.PreAuthEncryptedTimestamp;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.apache.directory.server.kerberos.shared.messages.value.types.KerberosErrorType;
 
 
 /**
@@ -81,9 +81,9 @@
     {
         Map<Class, Class> map = new HashMap<Class, Class>();
 
-        map.put( EncryptedTimeStamp.class, EncryptedTimestampEncoder.class );
+        map.put( PreAuthEncryptedTimestamp.class, EncryptedTimestampEncoder.class );
         map.put( EncTicketPart.class, EncTicketPartEncoder.class );
-        map.put( AuthenticationReply.class, EncAsRepPartEncoder.class );
+        map.put( AuthServerReply.class, EncAsRepPartEncoder.class );
         map.put( TicketGrantReply.class, EncTgsRepPartEncoder.class );
         map.put( EncKrbPrivPart.class, EncKrbPrivPartEncoder.class );
         map.put( EncApRepPart.class, EncApRepPartEncoder.class );
@@ -98,7 +98,7 @@
 
         map.put( EncTicketPart.class, EncTicketPartDecoder.class );
         map.put( Authenticator.class, AuthenticatorDecoder.class );
-        map.put( EncryptedTimeStamp.class, EncryptedTimestampDecoder.class );
+        map.put( PreAuthEncryptedTimestamp.class, EncryptedTimestampDecoder.class );
         map.put( AuthorizationData.class, AuthorizationDataDecoder.class );
         map.put( EncKrbPrivPart.class, EncKrbPrivPartDecoder.class );
         map.put( EncApRepPart.class, EncApRepPartDecoder.class );
@@ -138,11 +138,11 @@
         }
         catch ( IOException ioe )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY, ioe );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_BAD_INTEGRITY, ioe );
         }
         catch ( ClassCastException cce )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY, cce );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_BAD_INTEGRITY, cce );
         }
     }
 
@@ -166,11 +166,11 @@
         }
         catch ( IOException ioe )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY, ioe );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_BAD_INTEGRITY, ioe );
         }
         catch ( ClassCastException cce )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY, cce );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_BAD_INTEGRITY, cce );
         }
     }
 
@@ -261,7 +261,7 @@
 
         if ( clazz == null )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_ETYPE_NOSUPP );
+            throw new KerberosException( KerberosErrorType.KDC_ERR_ETYPE_NOSUPP );
         }
 
         try
@@ -270,11 +270,11 @@
         }
         catch ( IllegalAccessException iae )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_ETYPE_NOSUPP, iae );
+            throw new KerberosException( KerberosErrorType.KDC_ERR_ETYPE_NOSUPP, iae );
         }
         catch ( InstantiationException ie )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_ETYPE_NOSUPP, ie );
+            throw new KerberosException( KerberosErrorType.KDC_ERR_ETYPE_NOSUPP, ie );
         }
     }
 }

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryption.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryption.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryption.java Mon Sep 24 03:18:05 2007
@@ -32,10 +32,10 @@
 
 import org.apache.directory.server.kerberos.shared.crypto.checksum.ChecksumEngine;
 import org.apache.directory.server.kerberos.shared.crypto.checksum.ChecksumType;
-import org.apache.directory.server.kerberos.shared.exceptions.ErrorType;
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.apache.directory.server.kerberos.shared.messages.value.types.KerberosErrorType;
 
 
 /**
@@ -93,7 +93,7 @@
     {
         byte[] Ke = deriveKey( key.getKeyValue(), getUsageKe( usage ), 64, 168 );
 
-        byte[] encryptedData = data.getCipherText();
+        byte[] encryptedData = data.getCipher();
 
         // extract the old checksum
         byte[] oldChecksum = new byte[getChecksumLength()];
@@ -115,7 +115,7 @@
         // compare checksums
         if ( !Arrays.equals( oldChecksum, newChecksum ) )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_BAD_INTEGRITY );
         }
 
         return withoutConfounder;

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryption.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryption.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryption.java Mon Sep 24 03:18:05 2007
@@ -31,10 +31,10 @@
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
 
-import org.apache.directory.server.kerberos.shared.exceptions.ErrorType;
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.apache.directory.server.kerberos.shared.messages.value.types.KerberosErrorType;
 
 
 /**
@@ -92,7 +92,7 @@
     public byte[] getDecryptedData( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException
     {
         // decrypt the data
-        byte[] decryptedData = decrypt( data.getCipherText(), key.getKeyValue() );
+        byte[] decryptedData = decrypt( data.getCipher(), key.getKeyValue() );
 
         // extract the old checksum
         byte[] oldChecksum = new byte[getChecksumLength()];
@@ -110,7 +110,7 @@
         // compare checksums
         if ( !Arrays.equals( oldChecksum, newChecksum ) )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_BAD_INTEGRITY );
         }
 
         // remove leading confounder and checksum

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java Mon Sep 24 03:18:05 2007
@@ -31,10 +31,10 @@
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
 
-import org.apache.directory.server.kerberos.shared.exceptions.ErrorType;
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.apache.directory.server.kerberos.shared.messages.value.types.KerberosErrorType;
 
 
 /**
@@ -83,7 +83,7 @@
     public byte[] getDecryptedData( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException
     {
         // decrypt the data
-        byte[] decryptedData = decrypt( data.getCipherText(), key.getKeyValue() );
+        byte[] decryptedData = decrypt( data.getCipher(), key.getKeyValue() );
 
         // extract the old checksum
         byte[] oldChecksum = new byte[getChecksumLength()];
@@ -101,7 +101,7 @@
         // compare checksums
         if ( !Arrays.equals( oldChecksum, newChecksum ) )
         {
-            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY );
+            throw new KerberosException( KerberosErrorType.KRB_AP_ERR_BAD_INTEGRITY );
         }
 
         // remove leading confounder and checksum

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/EncryptionType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/EncryptionType.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/EncryptionType.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/EncryptionType.java Mon Sep 24 03:18:05 2007
@@ -19,10 +19,8 @@
  */
 package org.apache.directory.server.kerberos.shared.crypto.encryption;
 
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
 
 
 /**
@@ -31,168 +29,177 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public final class EncryptionType implements Comparable<EncryptionType>
+public enum EncryptionType
 {
     /**
      * The "unknown" encryption type.
      */
-    public static final EncryptionType UNKNOWN = new EncryptionType( -1, "UNKNOWN" );
+    UNKNOWN( -1 ),
 
     /**
      * The "null" encryption type.
      */
-    public static final EncryptionType NULL = new EncryptionType( 0, "NULL" );
+    NULL( 0 ),
 
     /**
      * The des-cbc-crc encryption type.
      */
-    public static final EncryptionType DES_CBC_CRC = new EncryptionType( 1, "des-cbc-crc" );
+    DES_CBC_CRC( 1 ),
 
     /**
      * The des-cbc-md4 encryption type.
      */
-    public static final EncryptionType DES_CBC_MD4 = new EncryptionType( 2, "des-cbc-md4" );
+    DES_CBC_MD4( 2 ),
 
     /**
      * The des-cbc-md5 encryption type.
      */
-    public static final EncryptionType DES_CBC_MD5 = new EncryptionType( 3, "des-cbc-md5" );
+    DES_CBC_MD5( 3 ),
 
     /**
      * The reserved (4) encryption type.
      */
-    public static final EncryptionType RESERVED4 = new EncryptionType( 4, "[reserved]" );
+    RESERVED4( 4 ),
 
     /**
      * The des3-cbc-md5 encryption type.
      */
-    public static final EncryptionType DES3_CBC_MD5 = new EncryptionType( 5, "des3-cbc-md5" );
+    DES3_CBC_MD5( 5 ),
 
     /**
      * The reserved (6) encryption type.
      */
-    public static final EncryptionType RESERVED6 = new EncryptionType( 6, "[reserved]" );
+    RESERVED6( 6 ),
 
     /**
      * The des3-cbc-sha1 encryption type.
      */
-    public static final EncryptionType DES3_CBC_SHA1 = new EncryptionType( 7, "des3-cbc-sha1" );
+    DES3_CBC_SHA1( 7 ),
 
     /**
-     * The id-dsa-with-sha1-CmsOID encryption type.
+     * The dsaWithSHA1-CmsOID encryption type.
      */
-    public static final EncryptionType ID_DSA_WITH_SHA1_CMSOID = new EncryptionType( 9, "id-dsa-with-sha1-CmsOID" );
+    DSAWITHSHA1_CMSOID( 9 ),
 
     /**
      * The md5WithRSAEncryption-CmsOID encryption type.
      */
-    public static final EncryptionType MD5WITHRSAENCRYPTION_CMSOID = new EncryptionType( 10,
-        "md5WithRSAEncryption-CmsOID" );
+    MD5WITHRSAENCRYPTION_CMSOID( 10 ),
 
     /**
-     * The sha-1WithRSAEncryption-CmsOID encryption type.
+     * The sha1WithRSAEncryption-CmsOID encryption type.
      */
-    public static final EncryptionType SHA_1WITHRSAENCRYPTION_CMSOID = new EncryptionType( 11,
-        "sha-1WithRSAEncryption-CmsOID" );
+    SHA1WITHRSAENCRYPTION_CMSOID( 11 ),
 
     /**
-     * The rc2-cbc-EnvOID encryption type.
+     * The rc2CBC-EnvOID encryption type.
      */
-    public static final EncryptionType RC2_CBC_ENVOID = new EncryptionType( 12, "rc2-cbc-EnvOID" );
+    RC2CBC_ENVOID( 12 ),
 
     /**
      * The rsaEncryption-EnvOID encryption type.
      */
-    public static final EncryptionType RSAENCRYPTION_ENVOID = new EncryptionType( 13, "rsaEncryption-EnvOID" );
+    RSAENCRYPTION_ENVOID( 13 ),
 
     /**
-     * The id-RSAES-OAEP-EnvOID encryption type.
+     * The rsaES-OAEP-ENV-OID encryption type.
      */
-    public static final EncryptionType ID_RSAES_OAEP_ENVOID = new EncryptionType( 14, "id-RSAES-OAEP-EnvOID" );
+    RSAES_OAEP_ENV_OID( 14 ),
 
     /**
-     * The des-ede3-cbc-EnvOID encryption type.
+     * The des-ede3-cbc-Env-OID encryption type.
      */
-    public static final EncryptionType DES_EDE3_CBC_ENVOID = new EncryptionType( 15, "des-ede3-cbc-EnvOID" );
+    DES_EDE3_CBC_ENV_OID( 15 ),
 
     /**
      * The des3-cbc-sha1-kd encryption type.
      */
-    public static final EncryptionType DES3_CBC_SHA1_KD = new EncryptionType( 16, "des3-cbc-sha1-kd" );
+    DES3_CBC_SHA1_KD( 16 ),
 
     /**
      * The aes128-cts-hmac-sha1-96 encryption type.
      */
-    public static final EncryptionType AES128_CTS_HMAC_SHA1_96 = new EncryptionType( 17, "aes128-cts-hmac-sha1-96" );
+    AES128_CTS_HMAC_SHA1_96( 17 ),
 
     /**
      * The aes256-cts-hmac-sha1-96 encryption type.
      */
-    public static final EncryptionType AES256_CTS_HMAC_SHA1_96 = new EncryptionType( 18, "aes256-cts-hmac-sha1-96" );
+    AES256_CTS_HMAC_SHA1_96( 18 ),
 
     /**
      * The rc4-hmac encryption type.
      */
-    public static final EncryptionType RC4_HMAC = new EncryptionType( 23, "rc4-hmac" );
+    RC4_HMAC( 23 ),
 
     /**
      * The rc4-hmac-exp encryption type.
      */
-    public static final EncryptionType RC4_HMAC_EXP = new EncryptionType( 24, "rc4-hmac-exp" );
+    RC4_HMAC_EXP( 24 ),
 
     /**
      * The subkey-keymaterial encryption type.
      */
-    public static final EncryptionType SUBKEY_KEYMATERIAL = new EncryptionType( 65, "subkey-keymaterial" );
+    SUBKEY_KEYMATERIAL( 65 ),
 
     /**
      * The rc4-md4 encryption type.
      */
-    public static final EncryptionType RC4_MD4 = new EncryptionType( -128, "rc4-md4" );
+    RC4_MD4( -128 ),
 
     /**
      * The c4-hmac-old encryption type.
      */
-    public static final EncryptionType RC4_HMAC_OLD = new EncryptionType( -133, "rc4-hmac-old" );
+    RC4_HMAC_OLD( -133 ),
 
     /**
      * The rc4-hmac-old-exp encryption type.
      */
-    public static final EncryptionType RC4_HMAC_OLD_EXP = new EncryptionType( -135, "rc4-hmac-old-exp" );
-
-    /**
-     * Array for building a List of VALUES.
-     */
-    private static final EncryptionType[] values =
-        { UNKNOWN, NULL, DES_CBC_CRC, DES_CBC_MD4, DES_CBC_MD5, RESERVED4, DES3_CBC_MD5, RESERVED6, DES3_CBC_SHA1,
-            ID_DSA_WITH_SHA1_CMSOID, MD5WITHRSAENCRYPTION_CMSOID, SHA_1WITHRSAENCRYPTION_CMSOID, RC2_CBC_ENVOID,
-            RSAENCRYPTION_ENVOID, ID_RSAES_OAEP_ENVOID, DES_EDE3_CBC_ENVOID, DES3_CBC_SHA1_KD, AES128_CTS_HMAC_SHA1_96,
-            AES256_CTS_HMAC_SHA1_96, RC4_HMAC, RC4_HMAC_EXP, SUBKEY_KEYMATERIAL, RC4_MD4, RC4_HMAC_OLD,
-            RC4_HMAC_OLD_EXP };
-
-    /**
-     * A List of all the encryption type constants.
-     */
-    public static final List<EncryptionType> VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
-
-    /**
-     * The name of the encryption type.
-     */
-    private final String name;
+    RC4_HMAC_OLD_EXP( -135 );
 
     /**
      * The value/code for the encryption type.
      */
     private final int ordinal;
 
+    /** A map containing all the values */
+	private static Map<String, EncryptionType> encryptionTypes = new HashMap<String, EncryptionType>();
+	
+	/** Initialization of the previous map */
+	static
+	{
+		encryptionTypes.put( "null", NULL );
+		encryptionTypes.put( "des-cbc-crc", DES_CBC_CRC ); 
+		encryptionTypes.put( "des-cbc-md4", DES_CBC_MD4 );	    	
+		encryptionTypes.put( "des-cbc-md5", DES_CBC_MD5 );	    	
+		encryptionTypes.put( "[reserved]", RESERVED4 );	    	
+		encryptionTypes.put( "des3-cbc-md5", DES3_CBC_MD5 );	    	
+		encryptionTypes.put( "[reserved]", RESERVED6 );	    	
+		encryptionTypes.put( "des3-cbc-sha1", DES3_CBC_SHA1 );	    	
+		encryptionTypes.put( "dsaWithSHA1-CmsOID", DSAWITHSHA1_CMSOID );	    	
+		encryptionTypes.put( "md5WithRSAEncryption-CmsOID", MD5WITHRSAENCRYPTION_CMSOID );	    	
+		encryptionTypes.put( "sha1WithRSAEncryption-CmsOID", SHA1WITHRSAENCRYPTION_CMSOID );	    	
+		encryptionTypes.put( "rc2CBC-EnvOID", RC2CBC_ENVOID );	    	
+		encryptionTypes.put( "rsaEncryption-EnvOID", RSAENCRYPTION_ENVOID );	    	
+		encryptionTypes.put( "rsaES-OAEP-ENV-OID", RSAES_OAEP_ENV_OID );    	
+		encryptionTypes.put( "des-ede3-cbc-Env-OID", DES_EDE3_CBC_ENV_OID );	    	
+		encryptionTypes.put( "des3-cbc-sha1-kd", DES3_CBC_SHA1_KD );    	
+		encryptionTypes.put( "aes128-cts-hmac-sha1-96", AES128_CTS_HMAC_SHA1_96 );	    	
+		encryptionTypes.put( "aes256-cts-hmac-sha1-96", AES256_CTS_HMAC_SHA1_96 );	    	
+		encryptionTypes.put( "rc4-hmac", RC4_HMAC );	    	
+		encryptionTypes.put( "rc4-hmac-exp", RC4_HMAC_EXP );	    	
+		encryptionTypes.put( "subkey-keymaterial", SUBKEY_KEYMATERIAL );	    	
+		encryptionTypes.put( "rc4-md4", RC4_MD4 );	    
+		encryptionTypes.put( "rc4-hmac-old", RC4_HMAC_OLD );	    	
+		encryptionTypes.put( "rc4-hmac-old-exp", RC4_HMAC_OLD_EXP );	    	
+		encryptionTypes.put( "UNKNOWN", UNKNOWN );
+	}
 
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private EncryptionType( int ordinal, String name )
+    private EncryptionType( int ordinal )
     {
         this.ordinal = ordinal;
-        this.name = name;
     }
 
 
@@ -204,15 +211,34 @@
      */
     public static EncryptionType getTypeByOrdinal( int type )
     {
-        for ( int ii = 0; ii < values.length; ii++ )
-        {
-            if ( values[ii].ordinal == type )
-            {
-                return values[ii];
-            }
-        }
-
-        return UNKNOWN;
+    	switch ( type )
+    	{
+	    	case 0 : return NULL; 
+	    	case 1 : return DES_CBC_CRC; 
+	    	case 2 : return DES_CBC_MD4; 
+	    	case 3 : return DES_CBC_MD5; 
+	    	case 4 : return RESERVED4; 
+	    	case 5 : return DES3_CBC_MD5; 
+	    	case 6 : return RESERVED6; 
+	    	case 7 : return DES3_CBC_SHA1; 
+	    	case 9 : return DSAWITHSHA1_CMSOID; 
+	    	case 10 : return MD5WITHRSAENCRYPTION_CMSOID; 
+	    	case 11 : return SHA1WITHRSAENCRYPTION_CMSOID; 
+	    	case 12 : return RC2CBC_ENVOID; 
+	    	case 13 : return RSAENCRYPTION_ENVOID; 
+	    	case 14 : return RSAES_OAEP_ENV_OID; 
+	    	case 15 : return DES_EDE3_CBC_ENV_OID; 
+	    	case 16 : return DES3_CBC_SHA1_KD; 
+	    	case 17 : return AES128_CTS_HMAC_SHA1_96; 
+	    	case 18 : return AES256_CTS_HMAC_SHA1_96; 
+	    	case 23 : return RC4_HMAC; 
+	    	case 24 : return RC4_HMAC_EXP; 
+	    	case 65 : return SUBKEY_KEYMATERIAL; 
+	    	case -128 : return RC4_MD4; 
+	    	case -133 : return RC4_HMAC_OLD; 
+	    	case -135 : return RC4_HMAC_OLD_EXP; 
+			default : return UNKNOWN; 
+    	}
     }
 
 
@@ -234,18 +260,70 @@
      */
     public String getName()
     {
-        return name;
+        return this.toString();
     }
 
-
-    public int compareTo( EncryptionType that )
+    /**
+     * Get the EncryptionType given a String.
+     * @param type The encryption string we want to find
+     * @return The found EncryptionType, or UNKNOWN
+     */
+    public static EncryptionType getByName( String type )
     {
-        return ordinal - that.ordinal;
+    	if ( type == null )
+    	{
+    		return UNKNOWN;
+    	}
+    	
+    	String lcType = type.toLowerCase();
+    	
+    	if ( encryptionTypes.containsKey( lcType ) )
+    	{
+    		return encryptionTypes.get( lcType );
+    	}
+    	else
+    	{
+    		return UNKNOWN;
+    	}
     }
 
-
+    /**
+     * @see Object#toString()
+     */
     public String toString()
     {
-        return name + " (" + ordinal + ")";
+    	String name = null;
+    	
+    	switch (this )
+    	{
+	    	case NULL							: name = "NULL"; break; 
+	    	case DES_CBC_CRC					: name = "des-cbc-crc"; break; 
+	    	case DES_CBC_MD4					: name = "des-cbc-md4"; break;	    	
+	    	case DES_CBC_MD5					: name = "des-cbc-md5"; break;	    	
+	    	case RESERVED4						: name = "[reserved]"; break;	    	
+	    	case DES3_CBC_MD5					: name = "des3-cbc-md5"; break;	    	
+	    	case RESERVED6						: name = "[reserved]"; break;	    	
+	    	case DES3_CBC_SHA1					: name = "des3-cbc-sha1"; break;	    	
+	    	case DSAWITHSHA1_CMSOID				: name = "dsaWithSHA1-CmsOID"; break;	    	
+	    	case MD5WITHRSAENCRYPTION_CMSOID	: name = "md5WithRSAEncryption-CmsOID"; break;	    	
+	    	case SHA1WITHRSAENCRYPTION_CMSOID	: name = "sha1WithRSAEncryption-CmsOID"; break;	    	
+	    	case RC2CBC_ENVOID					: name = "rc2CBC-EnvOID"; break;	    	
+	    	case RSAENCRYPTION_ENVOID			: name = "rsaEncryption-EnvOID"; break;	    	
+	    	case RSAES_OAEP_ENV_OID				: name = "rsaES-OAEP-ENV-OID"; break;    	
+	    	case DES_EDE3_CBC_ENV_OID			: name = "des-ede3-cbc-Env-OID"; break;	    	
+	    	case DES3_CBC_SHA1_KD				: name = "des3-cbc-sha1-kd"; break;    	
+	    	case AES128_CTS_HMAC_SHA1_96		: name = "aes128-cts-hmac-sha1-96"; break;	    	
+	    	case AES256_CTS_HMAC_SHA1_96		: name = "aes256-cts-hmac-sha1-96"; break;	    	
+	    	case RC4_HMAC						: name = "rc4-hmac"; break;	    	
+	    	case RC4_HMAC_EXP					: name = "rc4-hmac-exp"; break;	    	
+	    	case SUBKEY_KEYMATERIAL				: name = "subkey-keymaterial"; break;	    	
+	    	case RC4_MD4						: name = "rc4-md4"; break;	    
+	    	case RC4_HMAC_OLD					: name = "rc4-hmac-old"; break;	    	
+	    	case RC4_HMAC_OLD_EXP				: name = "rc4-hmac-old-exp"; break;	    	
+	    	case UNKNOWN						: name = "UNKNOWN"; break;
+	    	default 							: name = "UNKNOWN";
+    	}
+
+    	return name + " (" + ordinal + ")";
     }
 }

Modified: directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java?rev=578743&r1=578742&r2=578743&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java (original)
+++ directory/apacheds/branches/apacheds-kerberos/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java Mon Sep 24 03:18:05 2007
@@ -51,7 +51,7 @@
 
     public byte[] getDecryptedData( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException
     {
-        return data.getCipherText();
+        return data.getCipher();
     }
 
 



Mime
View raw message