directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1039807 - in /directory: apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/ apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encTicketPart/act...
Date Sun, 28 Nov 2010 00:45:33 GMT
Author: elecharny
Date: Sun Nov 28 00:45:33 2010
New Revision: 1039807

URL: http://svn.apache.org/viewvc?rev=1039807&view=rev
Log:
o Renamed the AbstractReadByteArray class
o Added an AbstractReadOctetString class

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadBitString.java
      - copied, changed from r1039715, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadOctetString.java
      - copied, changed from r1039715, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java
Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encTicketPart/actions/StoreFlags.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataGrammar.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataStatesEnum.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/EncryptedDataInit.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/StoreCipher.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/actions/StoreFlags.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java?rev=1039807&r1=1039806&r2=1039807&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java
Sun Nov 28 00:45:33 2010
@@ -21,7 +21,7 @@ package org.apache.directory.shared.kerb
 
 
 import org.apache.directory.shared.asn1.ber.Asn1Container;
-import org.apache.directory.shared.asn1.codec.actions.AbstractReadByteArray;
+import org.apache.directory.shared.asn1.codec.actions.AbstractReadBitString;
 import org.apache.directory.shared.kerberos.codec.EncKdcRepPart.EncKdcRepPartContainer;
 import org.apache.directory.shared.kerberos.components.EncKdcRepPart;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
@@ -32,7 +32,7 @@ import org.apache.directory.shared.kerbe
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreFlags extends AbstractReadByteArray
+public class StoreFlags extends AbstractReadBitString
 {
 
     /**
@@ -48,7 +48,7 @@ public class StoreFlags extends Abstract
      * {@inheritDoc}
      */
     @Override
-    protected void setByteArry( byte[] data, Asn1Container container )
+    protected void setBitString( byte[] data, Asn1Container container )
     {
         EncKdcRepPartContainer encKdcRepPartContainer = ( EncKdcRepPartContainer ) container;
         EncKdcRepPart encKdcRepPart = encKdcRepPartContainer.getEncKdcRepPart();

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encTicketPart/actions/StoreFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encTicketPart/actions/StoreFlags.java?rev=1039807&r1=1039806&r2=1039807&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encTicketPart/actions/StoreFlags.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encTicketPart/actions/StoreFlags.java
Sun Nov 28 00:45:33 2010
@@ -21,7 +21,7 @@ package org.apache.directory.shared.kerb
 
 
 import org.apache.directory.shared.asn1.ber.Asn1Container;
-import org.apache.directory.shared.asn1.codec.actions.AbstractReadByteArray;
+import org.apache.directory.shared.asn1.codec.actions.AbstractReadBitString;
 import org.apache.directory.shared.kerberos.codec.encTicketPart.EncTicketPartContainer;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
 
@@ -31,7 +31,7 @@ import org.apache.directory.shared.kerbe
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreFlags extends AbstractReadByteArray
+public class StoreFlags extends AbstractReadBitString
 {
 
     /**
@@ -47,7 +47,7 @@ public class StoreFlags extends Abstract
      * {@inheritDoc}
      */
     @Override
-    protected void setByteArry( byte[] data, Asn1Container container )
+    protected void setBitString( byte[] data, Asn1Container container )
     {
         TicketFlags flags = new TicketFlags( data );
         EncTicketPartContainer encTickerPartContainer = ( EncTicketPartContainer ) container;

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataGrammar.java?rev=1039807&r1=1039806&r2=1039807&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataGrammar.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataGrammar.java
Sun Nov 28 00:45:33 2010
@@ -52,7 +52,6 @@ public final class EncryptedDataGrammar 
     /** The instance of grammar. EncryptedDataGrammar is a singleton */
     private static Grammar instance = new EncryptedDataGrammar();
 
-
     /**
      * Creates a new EncryptedDataGrammar object.
      */
@@ -144,9 +143,6 @@ public final class EncryptedDataGrammar 
     }
 
 
-    // ~ Methods
-    // ------------------------------------------------------------------------------------
-
     /**
      * Get the instance of this grammar
      * 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataStatesEnum.java?rev=1039807&r1=1039806&r2=1039807&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataStatesEnum.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/EncryptedDataStatesEnum.java
Sun Nov 28 00:45:33 2010
@@ -33,9 +33,6 @@ import org.apache.directory.shared.kerbe
  */
 public enum EncryptedDataStatesEnum implements States
 {
-    // ~ Static fields/initializers
-    // -----------------------------------------------------------------
-
     // Start
     START_STATE,                            // 0
     

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/EncryptedDataInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/EncryptedDataInit.java?rev=1039807&r1=1039806&r2=1039807&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/EncryptedDataInit.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/EncryptedDataInit.java
Sun Nov 28 00:45:33 2010
@@ -20,11 +20,11 @@
 package org.apache.directory.shared.kerberos.codec.encryptedData.actions;
 
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.encryptedData.EncryptedDataContainer;
 import org.apache.directory.shared.kerberos.components.EncryptedData;
 import org.slf4j.Logger;
@@ -66,10 +66,10 @@ public class EncryptedDataInit extends G
         // The Length should not be null
         if ( tlv.getLength() == 0 )
         {
-            LOG.error( I18n.err( I18n.ERR_04066 ) );
+            LOG.error( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );
 
             // This will generate a PROTOCOL_ERROR
-            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
+            throw new DecoderException( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );
         }
         
         if ( encryptedDataContainer.getEncryptedData() == null )

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/StoreCipher.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/StoreCipher.java?rev=1039807&r1=1039806&r2=1039807&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/StoreCipher.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/encryptedData/actions/StoreCipher.java
Sun Nov 28 00:45:33 2010
@@ -21,16 +21,8 @@ package org.apache.directory.shared.kerb
 
 
 import org.apache.directory.shared.asn1.ber.Asn1Container;
-import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
-import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.ber.tlv.Value;
-import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.asn1.codec.actions.AbstractReadOctetString;
 import org.apache.directory.shared.kerberos.codec.encryptedData.EncryptedDataContainer;
-import org.apache.directory.shared.kerberos.components.EncryptedData;
-import org.apache.directory.shared.ldap.util.StringTools;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -38,17 +30,10 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreCipher extends GrammarAction
+public class StoreCipher extends AbstractReadOctetString
 {
-    /** The logger */
-    private static final Logger LOG = LoggerFactory.getLogger( StoreCipher.class );
-
-    /** Speedup for logs */
-    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
-
-
     /**
-     * Instantiates a new EncryptedPartKvno action.
+     * Instantiates a new EncryptedPart Cipher action.
      */
     public StoreCipher()
     {
@@ -59,40 +44,11 @@ public class StoreCipher extends Grammar
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    @Override
+    protected void setOctetString( byte[] data, Asn1Container container )
     {
         EncryptedDataContainer encryptedDataContainer = ( EncryptedDataContainer ) container;
-
-        TLV tlv = encryptedDataContainer.getCurrentTLV();
-
-        // The Length should not be null
-        if ( tlv.getLength() == 0 ) 
-        {
-            LOG.error( I18n.err( I18n.ERR_04066 ) );
-
-            // This will generate a PROTOCOL_ERROR
-            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
-        }
-        
-        Value value = tlv.getValue();
-        
-        // The encrypted data should not be null
-        if ( value.getData() == null ) 
-        {
-            LOG.error( I18n.err( I18n.ERR_04066 ) );
-
-            // This will generate a PROTOCOL_ERROR
-            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
-        }
-        
-        EncryptedData encryptedData = encryptedDataContainer.getEncryptedData();
-        encryptedData.setCipher( value.getData() );
-        
-        if ( IS_DEBUG )
-        {
-            LOG.debug( "cipher : {}", StringTools.dumpBytes( value.getData() ) );
-        }
-        
-        encryptedDataContainer.setGrammarEndAllowed( true );
+        encryptedDataContainer.getEncryptedData().setCipher( data );
+        container.setGrammarEndAllowed( true );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/actions/StoreFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/actions/StoreFlags.java?rev=1039807&r1=1039806&r2=1039807&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/actions/StoreFlags.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbCredInfo/actions/StoreFlags.java
Sun Nov 28 00:45:33 2010
@@ -21,7 +21,7 @@ package org.apache.directory.shared.kerb
 
 
 import org.apache.directory.shared.asn1.ber.Asn1Container;
-import org.apache.directory.shared.asn1.codec.actions.AbstractReadByteArray;
+import org.apache.directory.shared.asn1.codec.actions.AbstractReadBitString;
 import org.apache.directory.shared.kerberos.codec.krbCredInfo.KrbCredInfoContainer;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
 
@@ -31,7 +31,7 @@ import org.apache.directory.shared.kerbe
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreFlags extends AbstractReadByteArray
+public class StoreFlags extends AbstractReadBitString
 {
 
     /**
@@ -47,7 +47,7 @@ public class StoreFlags extends Abstract
      * {@inheritDoc}
      */
     @Override
-    protected void setByteArry( byte[] data, Asn1Container container )
+    protected void setBitString( byte[] data, Asn1Container container )
     {
         KrbCredInfoContainer krbCredInfoContainer = ( KrbCredInfoContainer ) container;
         krbCredInfoContainer.getKrbCredInfo().setTicketFlags( new TicketFlags( data ) );

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadBitString.java
(from r1039715, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadBitString.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadBitString.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java&r1=1039715&r2=1039807&rev=1039807&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadBitString.java
Sun Nov 28 00:45:33 2010
@@ -31,14 +31,14 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used read the byte array from TLV
+ * The action used read a BITSTRING from a TLV
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadByteArray extends GrammarAction
+public abstract class AbstractReadBitString extends GrammarAction
 {
     /** The logger */
-    private static final Logger LOG = LoggerFactory.getLogger( AbstractReadByteArray.class
);
+    private static final Logger LOG = LoggerFactory.getLogger( AbstractReadBitString.class
);
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
@@ -47,7 +47,7 @@ public abstract class AbstractReadByteAr
     /**
      * Instantiates a new AbstractReadByteArray action.
      */
-    public AbstractReadByteArray( String name )
+    public AbstractReadBitString( String name )
     {
         super( name );
     }
@@ -60,7 +60,7 @@ public abstract class AbstractReadByteAr
      * @param data the data of the read TLV present in byte array format
      * @param container the container holding the ASN.1 object
      */
-    protected abstract void setByteArry( byte[] data, Asn1Container container );
+    protected abstract void setBitString( byte[] data, Asn1Container container );
 
 
     /**
@@ -80,11 +80,11 @@ public abstract class AbstractReadByteAr
         }
 
         byte[] data = tlv.getValue().getData();
-        setByteArry( data, container );
+        setBitString( data, container );
 
         if ( IS_DEBUG )
         {
-            LOG.debug( "byte array value : {}", StringTools.dumpBytes( data ) );
+            LOG.debug( "BITSTRING value : {}", StringTools.dumpBytes( data ) );
         }
     }
 }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadOctetString.java
(from r1039715, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadOctetString.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadOctetString.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java&r1=1039715&r2=1039807&rev=1039807&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadByteArray.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/codec/actions/AbstractReadOctetString.java
Sun Nov 28 00:45:33 2010
@@ -23,44 +23,58 @@ package org.apache.directory.shared.asn1
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
+import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used read the byte array from TLV
+ * The action used to read an OCTET STRING value
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadByteArray extends GrammarAction
+public abstract class AbstractReadOctetString extends GrammarAction
 {
     /** The logger */
-    private static final Logger LOG = LoggerFactory.getLogger( AbstractReadByteArray.class
);
+    private static final Logger LOG = LoggerFactory.getLogger( AbstractReadOctetString.class
);
 
-    /** Speedup for logs */
-    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
+    /** the acceptable maximum value for the expected value to be parsed */
+    private boolean canBeNull = Boolean.FALSE;
 
 
     /**
-     * Instantiates a new AbstractReadByteArray action.
+     * Instantiates a new AbstractReadInteger action.
      */
-    public AbstractReadByteArray( String name )
+    public AbstractReadOctetString( String name )
     {
         super( name );
     }
 
 
     /**
-     * gives a byte array to be set to the appropriate field of the ASN.1 object
-     * present in the container 
-     *
-     * @param data the data of the read TLV present in byte array format
-     * @param container the container holding the ASN.1 object
+     * Instantiates a new AbstractReadInteger action.
+     * 
+     * @param name The log message
+     * @param canBeNull Tells if the byte array can be null or not
      */
-    protected abstract void setByteArry( byte[] data, Asn1Container container );
+    public AbstractReadOctetString( String name, boolean canBeNull )
+    {
+        super( name );
+        
+        this.canBeNull = canBeNull;
+    }
+
+
+    /**
+     * 
+     * set the OCTET STRING value to the appropriate field of ASN.1 object present in the
container
+     * 
+     * @param value the OCTET STRING value
+     * @param container the ASN.1 object's container
+     */
+    protected abstract void setOctetString( byte[] value, Asn1Container container );
 
 
     /**
@@ -70,21 +84,26 @@ public abstract class AbstractReadByteAr
     {
         TLV tlv = container.getCurrentTLV();
 
-        // The Length should not be null, and should be 5
-        if ( tlv.getLength() != 5 )
+        // The Length should not be null
+        if ( ( tlv.getLength() == 0 ) && ( !canBeNull ) )
         {
             LOG.error( I18n.err( I18n.ERR_04066 ) );
 
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-
-        byte[] data = tlv.getValue().getData();
-        setByteArry( data, container );
-
-        if ( IS_DEBUG )
+        
+        Value value = tlv.getValue();
+        
+        // The data should not be null
+        if ( ( value.getData() == null ) && ( !canBeNull ) )
         {
-            LOG.debug( "byte array value : {}", StringTools.dumpBytes( data ) );
+            LOG.error( I18n.err( I18n.ERR_04066 ) );
+
+            // This will generate a PROTOCOL_ERROR
+            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
+        
+        setOctetString( value.getData(), container );
     }
 }



Mime
View raw message