OT: Just for fun , outputing a sound as access granted or denied

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.
	I did a small modification , make cryptsetup funny , these code is not
secure as i didn't verify changes on ogg123 & sound files.

When typing in wrong codes , you'll hear a woman voice `access denied' ,
and '`access granted' for right password.

I can't spread the sound file anyway , it's from DOOM 3 for linux.


- --- luks/keymanage.c    2010-05-28 00:32:10.000000000 +0800
+++ luks-mod/keymanage.c        2010-08-29 16:21:32.653337261 +0800
@@ -676,6 +676,28 @@
        return r;
 }

+#define MAX_SOUND_LEN 100
+#define MAX_CMD_LEN 200
+
+void Doom_Sound( int granted ) {
+       char *fName = (char *) malloc ( sizeof(char) * MAX_SOUND_LEN );
+       char *syscmd = (char* ) malloc ( sizeof(char) * MAX_CMD_LEN );
+
+       if ( granted ) {
+               strncpy (fName ,
"/usr/share/sounds/comp_access_granted.ogg" , MAX_SOUND_LEN );
+       } else {
+               strncpy (fName ,
"/usr/share/sounds/comp_access_denied.ogg" , MAX_SOUND_LEN );
+       }
+
+       if ( access ( fName , R_OK ) != -1 ) {
+               snprintf ( syscmd , MAX_CMD_LEN , "/usr/bin/ogg123 -d
alsa %s &>/dev/null" , fName );
+       }
+
+       if ( system ( syscmd ) ) {
+               return;
+       }
+}
+
 int LUKS_open_key_with_hdr(const char *device,
                           int keyIndex,
                           const char *password,
@@ -694,16 +716,20 @@

        for(i = 0; i < LUKS_NUMKEYS; i++) {
                r = LUKS_open_key(device, i, password, passwordLen, hdr,
*mk, ctx);
- -               if(r == 0)
+               if(r == 0) {
+                       Doom_Sound ( 1 );
                        return i;
+               }

                /* Do not retry for errors that are no -EPERM or -ENOENT,
                   former meaning password wrong, latter key slot
inactive */
- -               if ((r != -EPERM) && (r != -ENOENT))
+               if ((r != -EPERM) && (r != -ENOENT)) {
                        return r;
+               }
        }
        /* Warning, early returns above */
        log_err(ctx, _("No key available with this passphrase.\n"));
+       Doom_Sound ( 0 );
        return -EPERM;
 }


Just for fun as i said , if anyone like it ;-)

What do you guys think , i'd like to grab your opinions ;-)

P.S: if your system got attacked by a hacked /usr/bin/ogg123 or sound
files,  that's ..

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx7CRkACgkQvf41sEptMqC+iACgxMXbNcsuogRU3F0k8h/NrlH0
aAAAn3TbZp7QyOSmxeJ9CYt61SYZx+HJ
=wZ9C
-----END PGP SIGNATURE-----
_______________________________________________
dm-crypt mailing list
dm-crypt@xxxxxxxx
http://www.saout.de/mailman/listinfo/dm-crypt


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux