lib/auth/set-client-dh-params.js
function encryptClientDHInnerDataWithAES(context) {
    var hash = utility.createSHAHash(context.clientDHInnerData);
    var dataWithHash = Buffer.concat([hash, context.clientDHInnerData]);
    if (logger.isDebugEnabled()) {
        logger.debug('Data to be encrypted contains: hash(%s), clientDHInnerData(%s), total length %s',
            hash.length, context.clientDHInnerData.length, dataWithHash.length);
    }
    context.encryptClientDHInnerData = security.cipher.aesEncrypt(
        dataWithHash,
        context.aes.key,
        context.aes.iv
    );
    if (logger.isDebugEnabled()) {
        logger.debug('encryptClientDHInnerData(%s) = %s',
            context.encryptClientDHInnerData.length, context.encryptClientDHInnerData.toString('hex'));
    }
    return context;
}
function encryptClientDHInnerDataWithAES(context) {
    var hash = utility.createSHAHash(context.clientDHInnerData);
    var dataWithHash = Buffer.concat([hash, context.clientDHInnerData]);
    if (logger.isDebugEnabled()) {
        logger.debug('Data to be encrypted contains: hash(%s), clientDHInnerData(%s), total length %s',
            hash.length, context.clientDHInnerData.length, dataWithHash.length);
    }
    context.encryptClientDHInnerData = security.cipher.aesEncrypt(
        dataWithHash,
        context.aes.key,
        context.aes.iv
    );
    if (logger.isDebugEnabled()) {
        logger.debug('encryptClientDHInnerData(%s) = %s',
            context.encryptClientDHInnerData.length, context.encryptClientDHInnerData.toString('hex'));
    }
    return context;
}
function encryptClientDHInnerDataWithAES ( context ) { var hash = utility . createSHAHash ( context . clientDHInnerData ) ; var dataWithHash = Buffer . concat ( [ hash , context . clientDHInnerData ] ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( 'Data to be encrypted contains: hash(%s), clientDHInnerData(%s), total length %s' , hash . length , context . clientDHInnerData . length , dataWithHash . length ) ; } context . encryptClientDHInnerData = security . cipher . aesEncrypt ( dataWithHash , context . aes . key , context . aes . iv ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( 'encryptClientDHInnerData(%s) = %s' , context . encryptClientDHInnerData . length , context . encryptClientDHInnerData . toString ( 'hex' ) ) ; } return context ; }
Encrypt Client DH inner data
Encrypt Client DH inner data