#!/bin/sh

test_description="Check passphrase encryption"
. $SHARNESS_TEST_SRCDIR/sharness.sh

dd if=/dev/urandom of=enc.data bs=300K count=1 2>/dev/null
export CM_PASSPHRASE=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | xxd -p)
balloonparams="-balloon-s 123 -balloon-t 2"
test_expect_success "encrypting" "
    cmenctool $balloonparams -p <enc.data >enc.enc"
test_expect_success "decrypting" "
    cmenctool -d -p <enc.enc >enc.data.got"
test_expect_success "comparing" "test_cmp enc.data enc.data.got"

test_done
