src/main/java/org/tinyradius/packet/AbstractRadiusPacket.java
@Override
    protected byte[] updateRequestAuthenticator(String sharedSecret, int packetLength, byte[] attributes) {
        byte[] authenticator = new byte[16];
        for (int i = 0; i < 16; i++) {
            authenticator[i] = 0;
        }

        MessageDigest md5 = getMd5Digest();
        md5.reset();
        md5.update((byte) getPacketType());
        md5.update((byte) getPacketIdentifier());
        md5.update((byte) (packetLength >> 8));
        md5.update((byte) (packetLength & 0xff));
        md5.update(authenticator, 0, authenticator.length);
        md5.update(attributes, 0, attributes.length);
        md5.update(RadiusUtil.getUtf8Bytes(sharedSecret));
        return md5.digest();
    }
/**
     * Calculates the request authenticator as specified by RFC 2866.
     *
     * @see org.tinyradius.packet.RadiusPacket#updateRequestAuthenticator(java.lang.String, int, byte[])
     */
Calculates the request authenticator as specified by RFC 2866.
Calculates the request authenticator as specified by RFC 2866 .
@Override
    protected byte[] updateRequestAuthenticator(String sharedSecret, int packetLength, byte[] attributes) {
        byte[] authenticator = new byte[16];
        for (int i = 0; i < 16; i++) {
            authenticator[i] = 0;
        }
        MessageDigest md5 = getMd5Digest();
        md5.reset();
        md5.update((byte) getPacketType());
        md5.update((byte) getPacketIdentifier());
        md5.update((byte) (packetLength >> 8));
        md5.update((byte) (packetLength & 0xff));
        md5.update(authenticator, 0, authenticator.length);
        md5.update(attributes, 0, attributes.length);
        md5.update(RadiusUtil.getUtf8Bytes(sharedSecret));
        return md5.digest();
    }
@ Override protected byte [ ] updateRequestAuthenticator ( String sharedSecret , int packetLength , byte [ ] attributes ) { byte [ ] authenticator = new byte [ 16 ] ; for ( int i = 0 ; i < 16 ; i ++ ) { authenticator [ i ] = 0 ; } MessageDigest md5 = getMd5Digest ( ) ; md5 . reset ( ) ; md5 . update ( ( byte ) getPacketType ( ) ) ; md5 . update ( ( byte ) getPacketIdentifier ( ) ) ; md5 . update ( ( byte ) ( packetLength >> 8 ) ) ; md5 . update ( ( byte ) ( packetLength & 0xff ) ) ; md5 . update ( authenticator , 0 , authenticator . length ) ; md5 . update ( attributes , 0 , attributes . length ) ; md5 . update ( RadiusUtil . getUtf8Bytes ( sharedSecret ) ) ; return md5 . digest ( ) ; }
Calculates the request authenticator as specified by RFC 2866.
Calculates the request authenticator as specified by RFC 2866 .