Package org.apache.directory.server.kerberos.shared.messages.value

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


        authenticatorModifier.setClientTime( now );
        authenticatorModifier.setClientMicroSecond( clientMicroSeconds );
        authenticatorModifier.setSubSessionKey( subSessionKey );
        authenticatorModifier.setSequenceNumber( sequenceNumber );

        Checksum checksum = getBodyChecksum( requestBody, checksumType );
        authenticatorModifier.setChecksum( checksum );

        Authenticator authenticator = authenticatorModifier.getAuthenticator();

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

        {
            throw new KerberosException( ErrorType.KDC_ERR_SUMTYPE_NOSUPP );
        }

        ChecksumEngine digester = getEngine( checksumType );
        return new Checksum( checksumType, digester.calculateChecksum( bytes, key, usage ) );
    }
View Full Code Here

            throw new KerberosException( ErrorType.KDC_ERR_SUMTYPE_NOSUPP );
        }

        ChecksumType checksumType = checksum.getChecksumType();
        ChecksumEngine digester = getEngine( checksumType );
        Checksum newChecksum = new Checksum( checksumType, digester.calculateChecksum( bytes, key, usage ) );

        if ( !newChecksum.equals( checksum ) )
        {
            throw new KerberosException( ErrorType.KRB_AP_ERR_MODIFIED );
        }
    }
View Full Code Here

                    data = tag1.getOctets();
                    break;
            }
        }

        return new Checksum( type, data );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.kerberos.shared.messages.value.Checksum

Copyright © 2018 www.massapicom. 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.