public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in mail-filter/libdkim/files: libdkim-extra-options.patch
@ 2012-09-01  9:12 Alexander Vershilov (qnikst)
  0 siblings, 0 replies; only message in thread
From: Alexander Vershilov (qnikst) @ 2012-09-01  9:12 UTC (permalink / raw
  To: gentoo-commits

qnikst      12/09/01 09:12:02

  Added:                libdkim-extra-options.patch
  Log:
  adding libdkim ebuild, thanks to slepnoga #262919
  
  (Portage version: 2.2.0_alpha120/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  mail-filter/libdkim/files/libdkim-extra-options.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/libdkim/files/libdkim-extra-options.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/libdkim/files/libdkim-extra-options.patch?rev=1.1&content-type=text/plain

Index: libdkim-extra-options.patch
===================================================================
diff -Naur libdkim.orig/src/libdkimtest.cpp libdkim/src/libdkimtest.cpp
--- libdkim.orig/src/libdkimtest.cpp	2009-03-13 16:17:45.000000000 -0500
+++ libdkim/src/libdkimtest.cpp	2009-03-13 16:26:02.000000000 -0500
@@ -55,8 +55,23 @@
 	return 0;
 }
 
+void usage()
+{
 
-
+	printf( "usage: libdkimtest [-b<allman|ietf|both>] [-c<r|s|t|u>] [-d<domain>] [-l] [-h] [-i<you@yourdomain.com>] [-q] [-s] [-t] [-v] [-x<expire time>] [-z<hash>] <msgfile> <privkeyfile> <outfile>\n");
+	printf( "-b<standard> allman , ietf or both\n");
+	printf( "-c<canonicalization> r for relaxed [DEFAULT], s - simple, t relaxed/simple, u - simple/relaxed\n");
+	printf( "-d<domain> the domain tag, if not provided it will be determined from the sender/from header\n");
+	printf( "-l include body length tag\n");
+	printf( "-h this help\n");
+	printf( "-i<identity> the identity, if not provided it will not be included\n");
+	printf( "-s sign the message\n");
+	printf( "-t include a timestamp tag\n");
+	printf( "-v verify the message\n");
+	printf( "-x<expire_time> the expire time in seconds since epoch ( DEFAULT = current time + 604800)\n\t if set to - then it will not be included");
+	printf( "-z<hash>  1 for sha1, 2 for sha256, 3 for both\n");
+	printf( "-y<selector> the selector tag DEFAULT=MDaemon\n");
+}
 int main(int argc, char* argv[])
 {
 	int n;
@@ -77,7 +92,7 @@
 	time(&t);
 
 	opts.nCanon = DKIM_SIGN_RELAXED;
-	opts.nIncludeBodyLengthTag = 1;
+	opts.nIncludeBodyLengthTag = 0;
 	opts.nIncludeQueryMethod = 0;
 	opts.nIncludeTimeStamp = 0;
 	opts.expireTime = t + 604800;		// expires in 1 week
@@ -92,6 +107,11 @@
 	int nArgParseState = 0;
 	bool bSign = true;
 
+	if(argc<2){
+		usage();
+		exit(1);
+	}
+
 	for( n = 1; n < argc; n++ )
 	{
 		if( argv[n][0] == '-' && strlen(argv[n]) > 1 )
@@ -121,14 +141,16 @@
 				}
 				break;
 
-
+			case 'd': 
+				strncpy(opts.szDomain,(const char*)(argv[n]+2),sizeof(opts.szDomain)-1);
+				break;
 			case 'l':		// body length tag
 				opts.nIncludeBodyLengthTag = 1;
 				break;
 
 
 			case 'h':
-				printf( "usage: \n" );
+				usage();	
 				return 0;
 
 			case 'i':		// identity 
@@ -138,7 +160,7 @@
 				}
 				else
 				{
-					strcpy( opts.szIdentity, argv[n] + 2 );
+					strncpy( opts.szIdentity, argv[n] + 2,sizeof(opts.szIdentity)-1 );
 				}
 				break;
 
@@ -169,6 +191,9 @@
 				}
 				break;
 
+			case 'y':
+				strncpy( opts.szSelector, argv[n]+2, sizeof(opts.szSelector)-1);
+				break;
 
 			case 'z':		// sign w/ sha1, sha256 or both 
 				opts.nHash = atoi( &argv[n][2] );





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-01  9:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-01  9:12 [gentoo-commits] gentoo-x86 commit in mail-filter/libdkim/files: libdkim-extra-options.patch Alexander Vershilov (qnikst)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox