head	1.3;
access;
symbols
	perseant-exfatfs-base-20250801:1.3
	perseant-exfatfs-base-20240630:1.3
	perseant-exfatfs:1.3.0.24
	perseant-exfatfs-base:1.3
	cjep_sun2x:1.3.0.22
	cjep_sun2x-base:1.3
	cjep_staticlib_x-base1:1.3
	cjep_staticlib_x:1.3.0.20
	cjep_staticlib_x-base:1.3
	phil-wifi-20200421:1.3
	phil-wifi-20200411:1.3
	phil-wifi-20200406:1.3
	pgoyette-compat-merge-20190127:1.3
	pgoyette-compat-20190127:1.3
	pgoyette-compat-20190118:1.3
	pgoyette-compat-1226:1.3
	pgoyette-compat-1126:1.3
	pgoyette-compat-1020:1.3
	pgoyette-compat-0930:1.3
	pgoyette-compat-0906:1.3
	pgoyette-compat-0728:1.3
	pgoyette-compat-0625:1.3
	pgoyette-compat-0521:1.3
	pgoyette-compat-0502:1.3
	pgoyette-compat-0422:1.3
	pgoyette-compat-0415:1.3
	pgoyette-compat-0407:1.3
	pgoyette-compat-0330:1.3
	pgoyette-compat-0322:1.3
	pgoyette-compat-0315:1.3
	pgoyette-compat:1.3.0.18
	pgoyette-compat-base:1.3
	perseant-stdc-iso10646:1.3.0.16
	perseant-stdc-iso10646-base:1.3
	prg-localcount2-base3:1.3
	prg-localcount2-base2:1.3
	prg-localcount2-base1:1.3
	prg-localcount2:1.3.0.14
	prg-localcount2-base:1.3
	pgoyette-localcount-20170426:1.3
	bouyer-socketcan-base1:1.3
	pgoyette-localcount-20170320:1.3
	bouyer-socketcan:1.3.0.12
	bouyer-socketcan-base:1.3
	pgoyette-localcount-20170107:1.3
	pgoyette-localcount-20161104:1.3
	localcount-20160914:1.3
	pgoyette-localcount-20160806:1.3
	pgoyette-localcount-20160726:1.3
	pgoyette-localcount:1.3.0.10
	pgoyette-localcount-base:1.3
	yamt-pagecache-base9:1.3
	yamt-pagecache-tag8:1.3
	tls-earlyentropy:1.3.0.6
	tls-earlyentropy-base:1.3
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.3
	riastradh-drm2-base3:1.3
	agc-symver:1.3.0.8
	agc-symver-base:1.3
	tls-maxphys-base:1.3
	yamt-pagecache-base8:1.3
	yamt-pagecache-base7:1.3
	yamt-pagecache-base6:1.3
	yamt-pagecache-base5:1.3
	yamt-pagecache-base4:1.3
	yamt-pagecache-base3:1.3
	yamt-pagecache-base2:1.3
	yamt-pagecache:1.3.0.4
	yamt-pagecache-base:1.3
	bouyer-quota2-nbase:1.3
	bouyer-quota2:1.3.0.2
	bouyer-quota2-base:1.3
	matt-premerge-20091211:1.1;
locks; strict;
comment	@# @;


1.3
date	2010.11.11.23.01.00;	author pooka;	state dead;
branches;
next	1.2;

1.2
date	2009.12.19.15.03.34;	author pooka;	state Exp;
branches;
next	1.1;

1.1
date	2009.09.08.21.48.25;	author pooka;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Remove some programs which live as atf tests now.
@
text
@PROG=	img2cgd
SRCS=	img2cgd.c
NOMAN=

.include <bsd.own.mk>

RUMP_ACTION=	#defined
CPPFLAGS+=	-DCGDCONFIG_AS_LIB
.include "${NETBSDSRCDIR}/sbin/cgdconfig/Makefile.cgdconfig"

DBG=	-g -O0
WARNS=	3

.include <bsd.prog.mk>
@


1.2
log
@Use RUMP_ACTION to avoid having to specify the same information
in the Makefiles of all the consumers.
@
text
@@


1.1
log
@Add a simple proof-of-concept program which shows how to use the
kernel cgd driver in an application which encrypts and decrypts
files.  The cgd driver is running completely in userspace and
requires no special access privileges.

For example:

golem> dmesg > dmesg.txt

# write encrypted dmesg.txt to encrypted.img
golem> ./img2cgd write encrypted.img dmesg.txt
/cryptfile's passphrase:

# read encrypted.img and output decrypted contents to decrypted.txt
golem> ./img2cgd read encrypted.img decypted.txt
/cryptfile's passphrase:
golem> diff dmesg.txt decypted.txt

# but when entering a different password:
golem> ./img2cgd read encrypted.img decypted.txt
/cryptfile's passphrase:
golem> diff dmesg.txt decypted.txt
Binary files dmesg.txt and decypted.txt differ

Currently the utility writes the data length in a proprietary
format, but I'll convert it to use a real disklabel RSN.  Then it
can be used to create cgd-encrypted disk images.

This program can later be used as a base for a utility to create
cgd-encrypted images of a standard NetBSD build.  Idea for such a
tool and hence the inspiration for this simple example program from
Roland Dowdeswell.
@
text
@d2 1
a2 1
SRCS=	img2cgd.c cgd_rumpops.c
d7 2
d11 2
a12 6
LDADD+=	-lrumpdev_cgd -lrumpdev_disk -lrumpdev -lrumpcrypto
LDADD+=	-lrumpvfs -lrump -lrumpuser -lpthread

CPPFLAGS+=	-DCGDCONFIG_AS_LIB

DBG=-g -O0
@

