You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2013/02/26 18:45:15 UTC
svn commit: r1450303 - in /directory/apacheds/trunk:
kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/
kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/
kerberos-codec/src/main/java/org...
Author: elecharny
Date: Tue Feb 26 17:45:14 2013
New Revision: 1450303
URL: http://svn.apache.org/r1450303
Log:
Added some missing licences and @author tags
Modified:
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordDecoder.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordEncoder.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataContainer.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataGrammar.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataStatesEnum.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/ChangePasswdDataInit.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreNewPassword.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargName.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargRealm.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ChangePasswdData.java
directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ChangePasswdDataDecoderTest.java
directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/ChangePasswordConfig.java
directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/KerberosConfig.java
directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosDecoder.java
directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosEncoder.java
directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateChngPwdServer.java
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordDecoder.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordDecoder.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordDecoder.java Tue Feb 26 17:45:14 2013
@@ -1,6 +1,25 @@
-
+/*
+ * 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.changepwd.io;
+
import java.nio.ByteBuffer;
import java.nio.InvalidMarkException;
@@ -10,6 +29,10 @@ import org.apache.directory.server.kerbe
import org.apache.directory.server.kerberos.changepwd.messages.ChangePasswordReply;
import org.apache.directory.server.kerberos.changepwd.messages.ChangePasswordRequest;
+
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
public class ChangePasswordDecoder
{
public static AbstractPasswordMessage decode( ByteBuffer buf, boolean isTcp ) throws ChangePasswordException
@@ -21,38 +44,38 @@ public class ChangePasswordDecoder
buf.getInt();
buf.mark();
}
-
+
// cause we don't have a special message type value, try decoding as request, reply and error and send whichever succeeds
-
+
try
{
return ChangePasswordRequest.decode( buf );
}
- catch( Exception e )
+ catch ( Exception e )
{
resetOrRewind( buf );
}
-
+
try
{
return ChangePasswordReply.decode( buf );
}
- catch( Exception e )
+ catch ( Exception e )
{
resetOrRewind( buf );
}
-
+
return ChangePasswordError.decode( buf );
}
-
-
+
+
private static void resetOrRewind( ByteBuffer buf )
{
try
{
buf.reset();
}
- catch( InvalidMarkException e )
+ catch ( InvalidMarkException e )
{
buf.rewind();
}
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordEncoder.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordEncoder.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/io/ChangePasswordEncoder.java Tue Feb 26 17:45:14 2013
@@ -1,19 +1,39 @@
-
+/*
+ * 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.changepwd.io;
+
import java.nio.ByteBuffer;
-import org.apache.directory.server.kerberos.changepwd.messages.AbstractPasswordMessage;
import org.apache.directory.api.asn1.EncoderException;
+import org.apache.directory.server.kerberos.changepwd.messages.AbstractPasswordMessage;
+
public class ChangePasswordEncoder
{
public static ByteBuffer encode( AbstractPasswordMessage chngPwdMsg, boolean isTcp ) throws EncoderException
{
int len = chngPwdMsg.computeLength();
-
+
ByteBuffer buf;
- if( isTcp )
+ if ( isTcp )
{
buf = ByteBuffer.allocate( len + 4 );
buf.putInt( len );
@@ -22,10 +42,10 @@ public class ChangePasswordEncoder
{
buf = ByteBuffer.allocate( len );
}
-
+
buf = chngPwdMsg.encode( buf );
buf.flip();
-
+
return buf;
}
}
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataContainer.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataContainer.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataContainer.java Tue Feb 26 17:45:14 2013
@@ -1,5 +1,25 @@
+/*
+ * 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.shared.kerberos.codec.changePwdData;
+
import java.nio.ByteBuffer;
import org.apache.directory.api.asn1.ber.AbstractContainer;
@@ -9,12 +29,14 @@ import org.apache.directory.shared.kerbe
/**
* The ChangePasswdData container.
*
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class ChangePasswdDataContainer extends AbstractContainer
{
/** An ChangePasswdData container */
private ChangePasswdData chngPwdData;
+
/**
* Creates a new ChangePasswdDataContainer object.
* @param stream The stream containing the data to decode
@@ -36,7 +58,7 @@ public class ChangePasswdDataContainer e
return chngPwdData;
}
-
+
/**
* Set an ChangePasswdData Object into the container. It will be completed by the
* KerberosDecoder.
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataGrammar.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataGrammar.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataGrammar.java Tue Feb 26 17:45:14 2013
@@ -1,3 +1,22 @@
+/*
+ * 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.shared.kerberos.codec.changePwdData;
@@ -18,6 +37,7 @@ import org.apache.directory.shared.kerbe
* in this class. As it is a singleton, these declaration are only done once. If
* an action is to be added or modified, this is where the work is to be done !
*
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public final class ChangePasswdDataGrammar extends AbstractGrammar<ChangePasswdDataContainer>
{
@@ -68,7 +88,8 @@ public final class ChangePasswdDataGramm
// --------------------------------------------------------------------------------------------
// ChangePasswdData ::= SEQUENCE {
// newPasswd [0] OCTET STRING,
- super.transitions[ChangePasswdDataStatesEnum.CHNGPWD_NEWPASSWD_TAG_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
+ super.transitions[ChangePasswdDataStatesEnum.CHNGPWD_NEWPASSWD_TAG_STATE.ordinal()][UniversalTag.OCTET_STRING
+ .getValue()] =
new GrammarTransition<ChangePasswdDataContainer>(
ChangePasswdDataStatesEnum.CHNGPWD_NEWPASSWD_TAG_STATE,
ChangePasswdDataStatesEnum.CHNGPWD_NEWPASSWD_STATE,
@@ -109,7 +130,8 @@ public final class ChangePasswdDataGramm
// ...
// targName [1] PrincipalName OPTIONAL,
// targRealm [2] Realm OPTIONAL
- super.transitions[ChangePasswdDataStatesEnum.CHNGPWD_TARGREALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()] =
+ super.transitions[ChangePasswdDataStatesEnum.CHNGPWD_TARGREALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING
+ .getValue()] =
new GrammarTransition<ChangePasswdDataContainer>(
ChangePasswdDataStatesEnum.CHNGPWD_TARGREALM_TAG_STATE,
ChangePasswdDataStatesEnum.CHNGPWD_TARGREALM_STATE,
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataStatesEnum.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataStatesEnum.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/ChangePasswdDataStatesEnum.java Tue Feb 26 17:45:14 2013
@@ -1,3 +1,22 @@
+/*
+ * 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.shared.kerberos.codec.changePwdData;
@@ -8,26 +27,26 @@ import org.apache.directory.api.asn1.ber
/**
* This class store the ChangePasswdData grammar's constants.
*
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public enum ChangePasswdDataStatesEnum implements States
{
// Start
- START_STATE, // 0
+ START_STATE, // 0
// ----- ChangePasswdData message --------------------------------------
- CHNGPWD_SEQ_STATE, // 1
-
- CHNGPWD_NEWPASSWD_TAG_STATE, // 2
- CHNGPWD_NEWPASSWD_STATE, // 3
+ CHNGPWD_SEQ_STATE, // 1
- CHNGPWD_TARGNAME_TAG_STATE, // 4
+ CHNGPWD_NEWPASSWD_TAG_STATE, // 2
+ CHNGPWD_NEWPASSWD_STATE, // 3
- CHNGPWD_TARGREALM_TAG_STATE, // 5
- CHNGPWD_TARGREALM_STATE, // 6
+ CHNGPWD_TARGNAME_TAG_STATE, // 4
- // End
- LAST_CHNGPWD_STATE; // 7
+ CHNGPWD_TARGREALM_TAG_STATE, // 5
+ CHNGPWD_TARGREALM_STATE, // 6
+ // End
+ LAST_CHNGPWD_STATE; // 7
/**
* Get the grammar name
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/ChangePasswdDataInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/ChangePasswdDataInit.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/ChangePasswdDataInit.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/ChangePasswdDataInit.java Tue Feb 26 17:45:14 2013
@@ -1,10 +1,29 @@
+/*
+ * 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.shared.kerberos.codec.changePwdData.actions;
-import org.apache.directory.server.i18n.I18n;
import org.apache.directory.api.asn1.DecoderException;
import org.apache.directory.api.asn1.ber.grammar.GrammarAction;
import org.apache.directory.api.asn1.ber.tlv.TLV;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.kerberos.codec.changePwdData.ChangePasswdDataContainer;
import org.apache.directory.shared.kerberos.messages.ChangePasswdData;
import org.slf4j.Logger;
@@ -13,12 +32,15 @@ import org.slf4j.LoggerFactory;
/**
* The action used to initialize the Ticket object
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class ChangePasswdDataInit extends GrammarAction<ChangePasswdDataContainer>
{
/** The logger */
private static final Logger LOG = LoggerFactory.getLogger( ChangePasswdDataInit.class );
+
/**
* Instantiates a new TicketInit action.
*/
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreNewPassword.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreNewPassword.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreNewPassword.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreNewPassword.java Tue Feb 26 17:45:14 2013
@@ -1,3 +1,22 @@
+/*
+ * 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.shared.kerberos.codec.changePwdData.actions;
@@ -7,6 +26,8 @@ import org.apache.directory.shared.kerbe
/**
* The action used to set the new password
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class StoreNewPassword extends AbstractReadOctetString<ChangePasswdDataContainer>
{
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargName.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargName.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargName.java Tue Feb 26 17:45:14 2013
@@ -1,3 +1,22 @@
+/*
+ * 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.shared.kerberos.codec.changePwdData.actions;
@@ -8,6 +27,8 @@ import org.apache.directory.shared.kerbe
/**
* The action used to set the targname of ChangePasswdData
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class StoreTargName extends AbstractReadPrincipalName<ChangePasswdDataContainer>
{
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargRealm.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargRealm.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/changePwdData/actions/StoreTargRealm.java Tue Feb 26 17:45:14 2013
@@ -1,3 +1,22 @@
+/*
+ * 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.shared.kerberos.codec.changePwdData.actions;
@@ -7,6 +26,8 @@ import org.apache.directory.shared.kerbe
/**
* The action used to set the target realm of the ChangePasswdData
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class StoreTargRealm extends AbstractReadRealm<ChangePasswdDataContainer>
{
Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ChangePasswdData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ChangePasswdData.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ChangePasswdData.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/ChangePasswdData.java Tue Feb 26 17:45:14 2013
@@ -1,3 +1,22 @@
+/*
+ * 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.shared.kerberos.messages;
@@ -5,12 +24,12 @@ import java.nio.ByteBuffer;
import org.apache.directory.api.asn1.AbstractAsn1Object;
import org.apache.directory.api.asn1.EncoderException;
+import org.apache.directory.api.asn1.ber.tlv.BerValue;
import org.apache.directory.api.asn1.ber.tlv.TLV;
import org.apache.directory.api.asn1.ber.tlv.UniversalTag;
-import org.apache.directory.api.asn1.ber.tlv.BerValue;
+import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.kerberos.KerberosConstants;
import org.apache.directory.shared.kerberos.components.PrincipalName;
-import org.apache.directory.api.util.Strings;
/**
@@ -21,6 +40,8 @@ import org.apache.directory.api.util.Str
* targname[1] PrincipalName OPTIONAL,
* targrealm[2] Realm OPTIONAL
* }
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class ChangePasswdData extends AbstractAsn1Object
{
@@ -95,24 +116,24 @@ public class ChangePasswdData extends Ab
{
buffer = ByteBuffer.allocate( computeLength() );
}
-
+
// ChangePasswdData
buffer.put( UniversalTag.SEQUENCE.getValue() );
buffer.put( BerValue.getBytes( seqLen ) );
-
+
// newpasswd
buffer.put( ( byte ) KerberosConstants.CHNGPWD_NEWPWD_TAG );
buffer.put( BerValue.getBytes( newPasswdLen ) );
BerValue.encode( buffer, newPasswd );
-
+
if ( targName != null )
{
buffer.put( ( byte ) KerberosConstants.CHNGPWD_TARGNAME_TAG );
buffer.put( BerValue.getBytes( targNameLen ) );
-
+
targName.encode( buffer );
}
-
+
if ( targRealm != null )
{
buffer.put( ( byte ) KerberosConstants.CHNGPWD_TARGREALM_TAG );
@@ -121,7 +142,7 @@ public class ChangePasswdData extends Ab
buffer.put( BerValue.getBytes( targRealmLen - 2 ) );
buffer.put( Strings.getBytesUtf8( targRealm ) );
}
-
+
return buffer;
}
@@ -169,13 +190,12 @@ public class ChangePasswdData extends Ab
{
StringBuilder sb = new StringBuilder();
-
sb.append( "ChangePasswdData : \n" );
-
+
sb.append( " newPasswd : " ).append( newPasswd ).append( '\n' );
sb.append( " targName : " ).append( targName ).append( '\n' );
sb.append( " targRealm : " ).append( targRealm ).append( '\n' );
return sb.toString();
- }
+ }
}
Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ChangePasswdDataDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ChangePasswdDataDecoderTest.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ChangePasswdDataDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ChangePasswdDataDecoderTest.java Tue Feb 26 17:45:14 2013
@@ -1,6 +1,25 @@
-
+/*
+ * 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.shared.kerberos.codec;
+
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
@@ -12,6 +31,10 @@ import org.apache.directory.shared.kerbe
import org.apache.directory.shared.kerberos.messages.ChangePasswdData;
import org.junit.Test;
+
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
public class ChangePasswdDataDecoderTest
{
@@ -19,135 +42,219 @@ public class ChangePasswdDataDecoderTest
public void testDecodeChangePasswdData() throws Exception
{
Asn1Decoder decoder = new Asn1Decoder();
-
+
ByteBuffer buf = ByteBuffer.allocate( 0x30 );
buf.put( new byte[]
{
- 0x30, 0x2E,
- (byte)0xA0, 0x08, // newpasswd
- 0x04, 0x06, 's', 'e', 'c', 'r', 'e', 't',
- (byte)0xA1, 0x13, // targname
- 0x30, 0x11,
- (byte)0xA0, 0x03, // name-type
- 0x02, 0x01, 0x01, // NT-PRINCIPAL
- (byte)0xA1, 0x0A, // name-string
- 0x30, 0x08,
- 0x1B, 0x06, 'k', 'r', 'b', 't', 'g', 't',
- (byte)0xA2, 0x0D,
- 0x1B, 0x0B, 'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M'
-
- } );
-
+ 0x30, 0x2E,
+ ( byte ) 0xA0, 0x08, // newpasswd
+ 0x04,
+ 0x06,
+ 's',
+ 'e',
+ 'c',
+ 'r',
+ 'e',
+ 't',
+ ( byte ) 0xA1,
+ 0x13, // targname
+ 0x30,
+ 0x11,
+ ( byte ) 0xA0,
+ 0x03, // name-type
+ 0x02,
+ 0x01,
+ 0x01, // NT-PRINCIPAL
+ ( byte ) 0xA1,
+ 0x0A, // name-string
+ 0x30,
+ 0x08,
+ 0x1B,
+ 0x06,
+ 'k',
+ 'r',
+ 'b',
+ 't',
+ 'g',
+ 't',
+ ( byte ) 0xA2,
+ 0x0D,
+ 0x1B,
+ 0x0B,
+ 'E',
+ 'X',
+ 'A',
+ 'M',
+ 'P',
+ 'L',
+ 'E',
+ '.',
+ 'C',
+ 'O',
+ 'M'
+
+ } );
+
String decodedPdu = Strings.dumpBytes( buf.array() );
buf.flip();
-
+
ChangePasswdDataContainer container = new ChangePasswdDataContainer( buf );
-
+
decoder.decode( buf, container );
-
+
ChangePasswdData chngPwdData = container.getChngPwdData();
-
+
assertArrayEquals( "secret".getBytes(), chngPwdData.getNewPasswd() );
assertEquals( "krbtgt", chngPwdData.getTargName().getNameString() );
assertEquals( "EXAMPLE.COM", chngPwdData.getTargRealm() );
-
+
String encodedPdu = Strings.dumpBytes( chngPwdData.encode( null ).array() );
assertEquals( decodedPdu, encodedPdu );
}
-
+
+
@Test
public void testDecodeChangePasswdDataWithoutTargName() throws Exception
{
Asn1Decoder decoder = new Asn1Decoder();
-
+
ByteBuffer buf = ByteBuffer.allocate( 0x1B );
buf.put( new byte[]
{
- 0x30, 0x19,
- (byte)0xA0, 0x08, // newpasswd
- 0x04, 0x06, 's', 'e', 'c', 'r', 'e', 't',
- (byte)0xA2, 0x0D,
- 0x1B, 0x0B, 'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M'
-
- } );
-
+ 0x30, 0x19,
+ ( byte ) 0xA0, 0x08, // newpasswd
+ 0x04,
+ 0x06,
+ 's',
+ 'e',
+ 'c',
+ 'r',
+ 'e',
+ 't',
+ ( byte ) 0xA2,
+ 0x0D,
+ 0x1B,
+ 0x0B,
+ 'E',
+ 'X',
+ 'A',
+ 'M',
+ 'P',
+ 'L',
+ 'E',
+ '.',
+ 'C',
+ 'O',
+ 'M'
+
+ } );
+
String decodedPdu = Strings.dumpBytes( buf.array() );
buf.flip();
-
+
ChangePasswdDataContainer container = new ChangePasswdDataContainer( buf );
-
+
decoder.decode( buf, container );
-
+
ChangePasswdData chngPwdData = container.getChngPwdData();
-
+
assertArrayEquals( "secret".getBytes(), chngPwdData.getNewPasswd() );
assertEquals( "EXAMPLE.COM", chngPwdData.getTargRealm() );
-
+
String encodedPdu = Strings.dumpBytes( chngPwdData.encode( null ).array() );
assertEquals( decodedPdu, encodedPdu );
}
-
+
@Test
public void testDecodeChangePasswdDataWithoutTargRealm() throws Exception
{
Asn1Decoder decoder = new Asn1Decoder();
-
+
ByteBuffer buf = ByteBuffer.allocate( 0x21 );
buf.put( new byte[]
{
- 0x30, 0x1F,
- (byte)0xA0, 0x08, // newpasswd
- 0x04, 0x06, 's', 'e', 'c', 'r', 'e', 't',
- (byte)0xA1, 0x13, // targname
- 0x30, 0x11,
- (byte)0xA0, 0x03, // name-type
- 0x02, 0x01, 0x01, // NT-PRINCIPAL
- (byte)0xA1, 0x0A, // name-string
- 0x30, 0x08,
- 0x1B, 0x06, 'k', 'r', 'b', 't', 'g', 't'
- } );
-
+ 0x30, 0x1F,
+ ( byte ) 0xA0, 0x08, // newpasswd
+ 0x04,
+ 0x06,
+ 's',
+ 'e',
+ 'c',
+ 'r',
+ 'e',
+ 't',
+ ( byte ) 0xA1,
+ 0x13, // targname
+ 0x30,
+ 0x11,
+ ( byte ) 0xA0,
+ 0x03, // name-type
+ 0x02,
+ 0x01,
+ 0x01, // NT-PRINCIPAL
+ ( byte ) 0xA1,
+ 0x0A, // name-string
+ 0x30,
+ 0x08,
+ 0x1B,
+ 0x06,
+ 'k',
+ 'r',
+ 'b',
+ 't',
+ 'g',
+ 't'
+ } );
+
String decodedPdu = Strings.dumpBytes( buf.array() );
buf.flip();
-
+
ChangePasswdDataContainer container = new ChangePasswdDataContainer( buf );
-
+
decoder.decode( buf, container );
-
+
ChangePasswdData chngPwdData = container.getChngPwdData();
-
+
assertArrayEquals( "secret".getBytes(), chngPwdData.getNewPasswd() );
assertEquals( "krbtgt", chngPwdData.getTargName().getNameString() );
-
+
String encodedPdu = Strings.dumpBytes( chngPwdData.encode( null ).array() );
assertEquals( decodedPdu, encodedPdu );
}
-
+
+
@Test
public void testDecodeChangePasswdDataWithoutTargNameAndRealm() throws Exception
{
Asn1Decoder decoder = new Asn1Decoder();
-
+
ByteBuffer buf = ByteBuffer.allocate( 0x0C );
buf.put( new byte[]
{
- 0x30, 0x0A,
- (byte)0xA0, 0x08, // newpasswd
- 0x04, 0x06, 's', 'e', 'c', 'r', 'e', 't'
- } );
-
+ 0x30, 0x0A,
+ ( byte ) 0xA0, 0x08, // newpasswd
+ 0x04,
+ 0x06,
+ 's',
+ 'e',
+ 'c',
+ 'r',
+ 'e',
+ 't'
+ } );
+
String decodedPdu = Strings.dumpBytes( buf.array() );
buf.flip();
-
+
ChangePasswdDataContainer container = new ChangePasswdDataContainer( buf );
-
+
decoder.decode( buf, container );
-
+
ChangePasswdData chngPwdData = container.getChngPwdData();
-
+
assertArrayEquals( "secret".getBytes(), chngPwdData.getNewPasswd() );
-
+
String encodedPdu = Strings.dumpBytes( chngPwdData.encode( null ).array() );
assertEquals( decodedPdu, encodedPdu );
}
Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/ChangePasswordConfig.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/ChangePasswordConfig.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/ChangePasswordConfig.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/ChangePasswordConfig.java Tue Feb 26 17:45:14 2013
@@ -1,16 +1,40 @@
-
+/*
+ * 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;
+
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
public class ChangePasswordConfig extends KerberosConfig
{
/** The default change password principal name. */
private static final String SERVICE_PRINCIPAL_DEFAULT = "kadmin/changepw@EXAMPLE.COM";
+
public ChangePasswordConfig()
{
setServicePrincipal( SERVICE_PRINCIPAL_DEFAULT );
}
+
public ChangePasswordConfig( KerberosConfig kdcConfig )
{
setServicePrincipal( "kadmin/changepw@" + kdcConfig.getPrimaryRealm() );
Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/KerberosConfig.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/KerberosConfig.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/KerberosConfig.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/KerberosConfig.java Tue Feb 26 17:45:14 2013
@@ -1,3 +1,22 @@
+/*
+ * 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;
@@ -12,52 +31,55 @@ import org.apache.directory.shared.kerbe
import org.apache.directory.shared.kerberos.codec.types.PrincipalNameType;
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
public class KerberosConfig
{
/** The default kdc service principal */
public static final String DEFAULT_PRINCIPAL = "krbtgt/EXAMPLE.COM@EXAMPLE.COM";
-
+
/** The default kdc realm */
public static final String DEFAULT_REALM = "EXAMPLE.COM";
-
+
/** The default allowable clockskew */
public static final long DEFAULT_ALLOWABLE_CLOCKSKEW = 5 * 60000;
-
+
/** The default for allowing empty addresses */
public static final boolean DEFAULT_EMPTY_ADDRESSES_ALLOWED = true;
-
+
/** The default for requiring encrypted timestamps */
public static final boolean DEFAULT_PA_ENC_TIMESTAMP_REQUIRED = true;
-
+
/** The default for the maximum ticket lifetime */
public static final int DEFAULT_TGS_MAXIMUM_TICKET_LIFETIME = 60000 * 1440;
-
+
/** The default for the minimum ticket lifetime, 4 minutes */
public static final int DEFAULT_TGS_MINIMUM_TICKET_LIFETIME = 60000 * 4;
-
+
/** The default for the maximum renewable lifetime */
public static final int DEFAULT_TGS_MAXIMUM_RENEWABLE_LIFETIME = 60000 * 10080;
-
+
/** The default for allowing forwardable tickets */
public static final boolean DEFAULT_TGS_FORWARDABLE_ALLOWED = true;
-
+
/** The default for allowing proxiable tickets */
public static final boolean DEFAULT_TGS_PROXIABLE_ALLOWED = true;
-
+
/** The default for allowing postdated tickets */
public static final boolean DEFAULT_TGS_POSTDATED_ALLOWED = true;
-
+
/** The default for allowing renewable tickets */
public static final boolean DEFAULT_TGS_RENEWABLE_ALLOWED = true;
-
+
/** The default for verifying the body checksum */
public static final boolean DEFAULT_VERIFY_BODY_CHECKSUM = true;
-
+
/** The default encryption types */
public static final String[] DEFAULT_ENCRYPTION_TYPES = new String[]
{ "aes128-cts-hmac-sha1-96", "des-cbc-md5", "des3-cbc-sha1-kd" };
-
+
/** The primary realm */
private String primaryRealm = KerberosConfig.DEFAULT_REALM;
@@ -102,16 +124,17 @@ public class KerberosConfig
/* cached kerberos/changepassword service principal */
private KerberosPrincipal srvPrincipal;
-
+
private String searchBaseDn;
-
+
+
public KerberosConfig()
{
setSearchBaseDn( ServerDNConstants.USER_EXAMPLE_COM_DN );
prepareEncryptionTypes();
}
-
-
+
+
/**
* Returns the allowable clock skew.
*
@@ -211,7 +234,7 @@ public class KerberosConfig
this.encryptionTypes.add( encryptionType );
}
}
-
+
this.encryptionTypes = KerberosUtils.orderEtypesByStrength( this.encryptionTypes );
}
@@ -335,11 +358,11 @@ public class KerberosConfig
*/
public KerberosPrincipal getServicePrincipal()
{
- if( srvPrincipal == null )
+ if ( srvPrincipal == null )
{
srvPrincipal = new KerberosPrincipal( servicePrincipal, PrincipalNameType.KRB_NT_SRV_INST.getValue() );
}
-
+
return srvPrincipal;
}
@@ -383,7 +406,7 @@ public class KerberosConfig
this.isBodyChecksumVerified = isBodyChecksumVerified;
}
-
+
public String getSearchBaseDn()
{
return searchBaseDn;
@@ -395,7 +418,7 @@ public class KerberosConfig
this.searchBaseDn = searchBaseDn;
}
-
+
public long getMinimumTicketLifetime()
{
return minimumTicketLifetime;
@@ -427,7 +450,7 @@ public class KerberosConfig
}
}
}
-
+
encryptionTypes = KerberosUtils.orderEtypesByStrength( encryptionTypes );
}
}
Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosDecoder.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosDecoder.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosDecoder.java Tue Feb 26 17:45:14 2013
@@ -1,6 +1,25 @@
-
+/*
+ * 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.protocol.codec;
+
import java.nio.ByteBuffer;
import org.apache.directory.api.asn1.ber.Asn1Decoder;
@@ -10,6 +29,10 @@ import org.apache.mina.core.session.IoSe
import org.apache.mina.filter.codec.ProtocolDecoderAdapter;
import org.apache.mina.filter.codec.ProtocolDecoderOutput;
+
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
public class MinaKerberosDecoder extends ProtocolDecoderAdapter
{
/** the key used while storing message container in the session */
@@ -18,13 +41,15 @@ public class MinaKerberosDecoder extends
/** The ASN 1 decoder instance */
private Asn1Decoder asn1Decoder = new Asn1Decoder();
+
@Override
public void decode( IoSession session, IoBuffer in, ProtocolDecoderOutput out ) throws Exception
{
ByteBuffer buf = in.buf();
-
- KerberosMessageContainer kerberosMessageContainer = ( KerberosMessageContainer ) session.getAttribute( KERBEROS_MESSAGE_CONTAINER );
-
+
+ KerberosMessageContainer kerberosMessageContainer = ( KerberosMessageContainer ) session
+ .getAttribute( KERBEROS_MESSAGE_CONTAINER );
+
if ( kerberosMessageContainer == null )
{
kerberosMessageContainer = new KerberosMessageContainer();
Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosEncoder.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosEncoder.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/codec/MinaKerberosEncoder.java Tue Feb 26 17:45:14 2013
@@ -1,6 +1,25 @@
-
+/*
+ * 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.protocol.codec;
+
import java.nio.ByteBuffer;
import org.apache.directory.api.asn1.AbstractAsn1Object;
@@ -9,6 +28,10 @@ import org.apache.mina.core.session.IoSe
import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;
+
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
public class MinaKerberosEncoder extends ProtocolEncoderAdapter
{
Modified: directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateChngPwdServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateChngPwdServer.java?rev=1450303&r1=1450302&r2=1450303&view=diff
==============================================================================
--- directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateChngPwdServer.java (original)
+++ directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/annotations/CreateChngPwdServer.java Tue Feb 26 17:45:14 2013
@@ -1,11 +1,35 @@
-
+/*
+ * 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.annotations;
+
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
public @interface CreateChngPwdServer
{
/** The default kdc service principal */
String srvPrincipal() default "kadmin/changepw@EXAMPLE.COM";
+
/** The transports to use, default none */
- CreateTransport[] transports() default {};
+ CreateTransport[] transports() default
+ {};
}