Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 May 2005 15:38:31 GMT
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 77513 for review
Message-ID:  <200505261538.j4QFcVEO090640@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

http://perforce.freebsd.org/chv.cgi?CH=77513

Change 77513 by csjp@csjp_xor on 2005/05/26 15:37:54

	-introduce function pointer which will be dynamically initialized
	 to whatever checksum is stored with the object when -W is used.

Affected files ...

.. //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#7 edit

Differences ...

==== //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#7 (text+ko) ====

@@ -207,6 +207,7 @@
 	int nbytes;
 	const char *algo;
 	u_char digest[64];
+	int (*checksum)(const char *, u_char *);
 
 	error = extattr_get_file(pathname, MAC_CHKEXEC_ATTRN,
 	    MAC_CHKEXEC, (void *)&sum, sizeof(sum));
@@ -217,10 +218,12 @@
 	if (sum.vs_flags == MAC_VCSUM_SHA1) {
 		nbytes = SHA1_HASH_SIZE;
 		algo = "sha1";
+		checksum = calc_sha1;
 	}
 	else if (sum.vs_flags == MAC_VCSUM_MD5) {
 		nbytes = MD5_HASH_SIZE;
 		algo = "md5";
+		checksum = calc_md5;
 	} else {
 		warnx("%s: invalid checksum algorithm",
 		    pathname);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505261538.j4QFcVEO090640>