aboutsummaryrefslogtreecommitdiffstats
path: root/crypting.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-03-17 13:56:52 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-03-17 13:56:52 +0000
commit75554d0a484d21f95fcf24394f89c541a650acaf (patch)
tree51d9dc322baeb2e542fc13d9ba69e74f70a87636 /crypting.c
parente5e795dae28c7871a47040436454a456fb338820 (diff)
parentf9928cb319c2879a56b7280f09723b26035982d0 (diff)
Merging in 1.2.5.
Diffstat (limited to 'crypting.c')
-rw-r--r--crypting.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/crypting.c b/crypting.c
index 34b99034..0a5c937e 100644
--- a/crypting.c
+++ b/crypting.c
@@ -131,63 +131,3 @@ char *deobfucrypt (char *line, const char *password)
return (rv);
}
-
-#ifdef CRYPTING_MAIN
-
-/* A little main() function for people who want a stand-alone program to
- encode/decode BitlCrypted files. */
-
-int main( int argc, char *argv[] )
-{
- char *hash, *action, line[256];
- char* (*func)( char *, const char * );
-
- if( argc < 2 )
- {
- fprintf( stderr, "Usage: %s <password>\n\n"
- "Reads from stdin, writes to stdout.\n"
- "Call as \"encode\" to encode, \"decode\" to decode.\n", argv[0] );
- return( 1 );
- }
-
- hash = hashpass( argv[1] );
- action = argv[0] + strlen( argv[0] ) - strlen( "encode" );
-
- if( strcmp( action, "encode" ) == 0 )
- {
- fwrite( hash, 32, 1, stdout );
- func = obfucrypt;
- }
- else if( strcmp( action, "decode" ) == 0 )
- {
- char hash2[32];
-
- fread( hash2, 32, 1, stdin );
- if( memcmp( hash, hash2, 32 ) != 0 )
- {
- fprintf( stderr, "Passwords don't match. Can't decode.\n" );
- return( 1 );
- }
- func = deobfucrypt;
- }
- else
- {
- return( main( 0, NULL ) );
- }
-
- while( fscanf( stdin, "%[^\n]255s", line ) > 0 )
- {
- char *out;
-
- /* Flush the newline */
- fgetc( stdin );
-
- out = func( line, argv[1] );
- printf( "%s\n", out );
- g_free( out );
- }
-
- return( 0 );
-}
-
-#endif