Examples of TLV


Examples of org.apache.directory.api.asn1.ber.tlv.TLV

    /**
     * {@inheritDoc}
     */
    public void action( ETypeInfo2Container eTypeInfo2Container ) throws DecoderException
    {
        TLV tlv = eTypeInfo2Container.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 ) );
        }

        // Now, let's decode the ETYPE-INFO2-ENTRY
        Asn1Decoder etypeInfo2EntryDecoder = new Asn1Decoder();

        ETypeInfo2EntryContainer etypeInfo2EntryContainer = new ETypeInfo2EntryContainer();
        etypeInfo2EntryContainer.setStream( eTypeInfo2Container.getStream() );

        // Compute the start position in the stream for the ETypeInfoEntry to decode :
        // We have to move back to the ETypeInfoEntry tag
        eTypeInfo2Container.rewind();

        // Decode the ETypeInfo2Entry PDU
        try
        {
            etypeInfo2EntryDecoder.decode( eTypeInfo2Container.getStream(), etypeInfo2EntryContainer );
        }
        catch ( DecoderException de )
        {
            throw de;
        }

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Update the parent
        eTypeInfo2Container.updateParent();

        // Store the ETypeInfoEntry in the container
View Full Code Here

Examples of org.apache.directory.api.asn1.ber.tlv.TLV

    /**
     * {@inheritDoc}
     */
    public void action( ETypeInfo2EntryContainer eTypeInfo2EntryContainer ) throws DecoderException
    {
        TLV tlv = eTypeInfo2EntryContainer.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 ) );
View Full Code Here

Examples of org.apache.directory.api.asn1.ber.tlv.TLV

    /**
     * {@inheritDoc}
     */
    public void action( KdcReqContainer kdcReqContainer ) throws DecoderException
    {
        TLV tlv = kdcReqContainer.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 ) );
View Full Code Here

Examples of org.apache.directory.api.asn1.ber.tlv.TLV

    /**
     * {@inheritDoc}
     */
    public void action( EncKrbCredPartContainer encKrbCredPartContainer ) throws DecoderException
    {
        TLV tlv = encKrbCredPartContainer.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 ) );
        }

        // decoder for KrbCredInfo
        Asn1Decoder decoder = new Asn1Decoder();

        // KrbCredInfo container
        KrbCredInfoContainer ticketInfoContainer = new KrbCredInfoContainer();
        ticketInfoContainer.setStream( encKrbCredPartContainer.getStream() );

        encKrbCredPartContainer.rewind();

        try
        {
            // decode KrbCredInfo
            decoder.decode( encKrbCredPartContainer.getStream(), ticketInfoContainer );
        }
        catch ( DecoderException e )
        {
            throw e;
        }

        KrbCredInfo ticketInfo = ticketInfoContainer.getKrbCredInfo();
        // add KrbCredInfo to the list of ticket-info
        encKrbCredPartContainer.getEncKrbCredPart().addTicketInfo( ticketInfo );

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Update the parent
        encKrbCredPartContainer.updateParent();

        encKrbCredPartContainer.setGrammarEndAllowed( true );
View Full Code Here

Examples of org.apache.directory.api.asn1.ber.tlv.TLV

    /**
     * {@inheritDoc}
     */
    public void action( ETypeInfo2EntryContainer eTypeInfo2EntryContainer ) throws DecoderException
    {
        TLV tlv = eTypeInfo2EntryContainer.getCurrentTLV();
        ETypeInfo2Entry etypeInfo2Entry = eTypeInfo2EntryContainer.getETypeInfo2Entry();

        // The Length may be null
        if ( tlv.getLength() != 0 )
        {
            BerValue value = tlv.getValue();

            // The encrypted data may be null
            if ( value.getData() != null )
            {
                String salt = Strings.utf8ToString( value.getData() );
View Full Code Here

Examples of org.apache.directory.api.asn1.ber.tlv.TLV

    /**
     * {@inheritDoc}
     */
    public void action( KdcRepContainer kdcRepContainer ) throws DecoderException
    {
        TLV tlv = kdcRepContainer.getCurrentTLV();

        // The Length can't 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 ) );
        }

        // Now, let's decode the PA-DATA
        Asn1Decoder paDataDecoder = new Asn1Decoder();

        PaDataContainer paDataContainer = new PaDataContainer();
        paDataContainer.setStream( kdcRepContainer.getStream() );

        // We have to move back to the PA-DATA tag
        kdcRepContainer.rewind();

        // Decode the PA-DATA PDU
        try
        {
            paDataDecoder.decode( kdcRepContainer.getStream(), paDataContainer );
        }
        catch ( DecoderException de )
        {
            throw de;
        }

        // Update the parent
        kdcRepContainer.updateParent();

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Store the PData in the container
        PaData paData = paDataContainer.getPaData();
        KdcRep kdcRep = kdcRepContainer.getKdcRep();
        kdcRep.addPaData( paData );
View Full Code Here

Examples of org.apache.directory.shared.asn1.ber.tlv.TLV

    public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException
    {
        SearchRequestDecorator searchRequest = container.getMessage();

        TLV tlv = container.getCurrentTLV();

        // Store the value.
        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) searchRequest.getTerminalFilter();

        // We get the value. If it's a 0, it's a FALSE. If it's
        // a FF, it's a TRUE. Any other value should be an error,
        // but we could relax this constraint. So if we have
        // something
        // which is not 0, it will be interpreted as TRUE, but we
        // will generate a warning.
        Value value = tlv.getValue();

        try
        {
            extensibleMatchFilter.setDnAttributes( BooleanDecoder.parse( value ) );
        }
View Full Code Here

Examples of org.apache.directory.shared.asn1.ber.tlv.TLV

    public void unstackFilters( Asn1Container container )
    {
        LdapMessageContainer<MessageDecorator<Message>> ldapMessageContainer =
            ( LdapMessageContainer<MessageDecorator<Message>> ) container;

        TLV tlv = ldapMessageContainer.getCurrentTLV();
        TLV localParent = tlv.getParent();
        Filter localFilter = terminalFilter;

        // The parent has been completed, so fold it
        while ( ( localParent != null ) && ( localParent.getExpectedLength() == 0 ) )
        {
            int parentTlvId = localFilter.getParent() != null ? localFilter.getParent().getTlvId() : localFilter
                .getParentTlvId();

            if ( localParent.getId() != parentTlvId )
            {
                localParent = localParent.getParent();
            }
            else
            {
                Filter filterParent = localFilter.getParent();

                // We have a special case with PresentFilter, which has not been
                // pushed on the stack, so we need to get its parent's parent
                if ( localFilter instanceof PresentFilter )
                {
                    if ( filterParent == null )
                    {
                        // We don't have parent, get out
                        break;
                    }

                    filterParent = filterParent.getParent();
                }
                else if ( filterParent instanceof Filter )
                {
                    filterParent = filterParent.getParent();
                }

                if ( filterParent instanceof Filter )
                {
                    // The parent is a filter ; it will become the new currentFilter
                    // and we will loop again.
                    currentFilter = ( Filter ) filterParent;
                    localFilter = currentFilter;
                    localParent = localParent.getParent();
                }
                else
                {
                    // We can stop the recursion, we have reached the searchResult Object
                    break;
View Full Code Here

Examples of org.apache.directory.shared.asn1.ber.tlv.TLV

                SubentriesStates.SUB_ENTRY_VISIBILITY_STATE, UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SubentriesContainer>( "SubEntryControl visibility" )
                {
                    public void action( SubentriesContainer container ) throws DecoderException
                    {
                        TLV tlv = container.getCurrentTLV();

                        // We get the value. If it's a 0, it's a FALSE. If it's
                        // a FF, it's a TRUE. Any other value should be an error,
                        // but we could relax this constraint. So if we have
                        // something
                        // which is not 0, it will be interpreted as TRUE, but we
                        // will generate a warning.
                        Value value = tlv.getValue();

                        try
                        {
                            container.getSubentriesControl().setVisibility( BooleanDecoder.parse( value ) );
View Full Code Here

Examples of org.apache.directory.shared.asn1.ber.tlv.TLV

    {
        if ( stream.hasRemaining() )
        {
            byte octet = stream.get();

            TLV tlv = new TLV( container.getNewTlvId() );
            tlv.setTag( octet );

            // Store the current TLV in the container.
            container.setCurrentTLV( tlv );

            // Create a link between the current TLV with its parent
            tlv.setParent( container.getParentTLV() );

            // Switch to the next state, which is the Length decoding
            container.setState( TLVStateEnum.LENGTH_STATE_START );

            if ( IS_DEBUG )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.