Examples of Checksum


Examples of org.apache.directory.server.kerberos.shared.messages.value.Checksum

        KdcServer config = tgsContext.getConfig();

        if ( config.isBodyChecksumVerified() )
        {
            byte[] bodyBytes = tgsContext.getRequest().getBodyBytes();
            Checksum authenticatorChecksum = tgsContext.getAuthenticator().getChecksum();

            if ( authenticatorChecksum == null || authenticatorChecksum.getChecksumType() == null
                || authenticatorChecksum.getChecksumValue() == null || bodyBytes == null )
            {
                throw new KerberosException( ErrorType.KRB_AP_ERR_INAPP_CKSUM );
            }

            LOG.debug( "Verifying body checksum type '{}'.", authenticatorChecksum.getChecksumType() );

            checksumHandler.verifyChecksum( authenticatorChecksum, bodyBytes, null, KeyUsage.NUMBER8 );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.Checksum

        // Check the decoded AdKdcIssued
        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer ).getAdKdcIssued();

        // The checksum
        Checksum checksum = adKdcIssued.getAdChecksum();

        assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "chksum" ), checksum.getChecksumValue() ) );

        // The realm
        assertNull( adKdcIssued.getIRealm() );

        // The sname
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.Checksum

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        Checksum checksum = checksumContainer.getChecksum();
        // The Checksum's type is an integer
        BerValue value = tlv.getValue();

        try
        {
            int cksumType = IntegerDecoder.parse( value );

            checksum.setChecksumType( ChecksumType.getTypeByValue( cksumType ) );

            if ( IS_DEBUG )
            {
                LOG.debug( "cksumType : " + cksumType );
            }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.Checksum

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        Checksum checksum = new Checksum();
        checksumContainer.setChecksum( checksum );

        if ( IS_DEBUG )
        {
            LOG.debug( "Checksum created" );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.Checksum

        authenticator.setCTime( now );
        authenticator.setCusec( clientMicroSeconds );
        authenticator.setSubKey( subSessionKey );
        authenticator.setSeqNumber( sequenceNumber );

        Checksum checksum = getBodyChecksum( requestBody, checksumType );
        authenticator.setCksum( checksum );

        EncryptedData encryptedAuthenticator = lockBox.seal( sessionKey, authenticator,
            KeyUsage.TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_TGS_SESS_KEY );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.Checksum

            {
                throw new KerberosException( ErrorType.KRB_AP_ERR_INAPP_CKSUM );
            }

            byte[] bodyBytes = buf.array();
            Checksum authenticatorChecksum = tgsContext.getAuthenticator().getCksum();

            if ( authenticatorChecksum != null )
            {
                // we need the session key
                Ticket tgt = tgsContext.getTgt();
                EncTicketPart encTicketPart = tgt.getEncTicketPart();
                EncryptionKey sessionKey = encTicketPart.getKey();

                if ( authenticatorChecksum == null || authenticatorChecksum.getChecksumType() == null
                    || authenticatorChecksum.getChecksumValue() == null || bodyBytes == null )
                {
                    throw new KerberosException( ErrorType.KRB_AP_ERR_INAPP_CKSUM );
                }

                LOG_KRB.debug( "Verifying body checksum type '{}'.", authenticatorChecksum.getChecksumType() );

                checksumHandler.verifyChecksum( authenticatorChecksum, bodyBytes, sessionKey.getKeyValue(),
                    KeyUsage.TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_AUTHNT_CKSUM_TGS_SESS_KEY );
            }
        }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.Checksum

        try
        {
            Ticket tgt = tgsContext.getTgt();
            long clockSkew = tgsContext.getConfig().getAllowableClockSkew();

            Checksum cksum = tgsContext.getAuthenticator().getCksum();

            ChecksumType checksumType = null;
            if ( cksum != null )
            {
                checksumType = cksum.getChecksumType();
            }

            InetAddress clientAddress = tgsContext.getClientAddress();
            HostAddresses clientAddresses = tgt.getEncTicketPart().getClientAddresses();
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Checksum

        getProject().log(this, "Copied file " + targetFile, Project.MSG_INFO);
    }

    private void writeChecksum(File srcFile, File targetFile) {
        Checksum checksum = new Checksum();
        checksum.setProject(getProject());
        checksum.setAlgorithm("SHA1");
        checksum.setFile(srcFile);
        String property = MavenPublishTask.class.getName()+".checksum.property."+srcFile.getAbsolutePath();
        checksum.setProperty(property);
        checksum.execute();
       
        Echo echo = new Echo();
        echo.setProject(getProject());
       
        File checksumFile = new File(targetFile.getParentFile(), targetFile.getName()+".sha1");
View Full Code Here

Examples of org.jdesktop.wonderland.common.checksums.Checksum

            logger.warning("Unable to locate checksum information for " +
                    assetURI.toExternalForm());
            return null;
        }

        Checksum checksum = moduleChecksums.getChecksumMap().get(path);
        if (checksum == null) {
            logger.warning("Unable to locate checksum for path " + path +
                    " for " + assetURI.toExternalForm());
            return null;
        }
        return checksum.getChecksum();
    }
View Full Code Here

Examples of org.jdesktop.wonderland.common.checksums.Checksum

    public static ChecksumList generate(File root, File file, String algorithm) throws NoSuchAlgorithmException {
        // Generate the checksum for the file, but put it in the list and
        // return
        try {
            MessageDigest digest = MessageDigest.getInstance(algorithm);
            Checksum checksum = computeChecksum(root, file, digest);
            ChecksumList checksumList = new ChecksumList();
            checksumList.putChecksum(checksum);
            return checksumList;
        } catch (java.io.IOException excp) {
            logger.log(Level.WARNING, "Unable to generate checksum for " +
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.