#! /usr/bin/perl # $OpenBSD: inject-badsum,v 1.1 2019/08/02 14:57:53 espie Exp $ use strict; use warnings; use OpenBSD::md5; package OpenBSD::digest; use Wrapper; wrap('digest_file', sub { my $original = shift; if ($_[1] =~ m,/a$,) { my $self = shift; my $d = $self->algo; $d->addfile("/dev/null"); return $d->digest; } else { goto &$original; } }); 1;