1 |
qnikst 12/09/01 09:12:02 |
2 |
|
3 |
Added: libdkim-extra-options.patch |
4 |
Log: |
5 |
adding libdkim ebuild, thanks to slepnoga #262919 |
6 |
|
7 |
(Portage version: 2.2.0_alpha120/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 mail-filter/libdkim/files/libdkim-extra-options.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/libdkim/files/libdkim-extra-options.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/libdkim/files/libdkim-extra-options.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: libdkim-extra-options.patch |
16 |
=================================================================== |
17 |
diff -Naur libdkim.orig/src/libdkimtest.cpp libdkim/src/libdkimtest.cpp |
18 |
--- libdkim.orig/src/libdkimtest.cpp 2009-03-13 16:17:45.000000000 -0500 |
19 |
+++ libdkim/src/libdkimtest.cpp 2009-03-13 16:26:02.000000000 -0500 |
20 |
@@ -55,8 +55,23 @@ |
21 |
return 0; |
22 |
} |
23 |
|
24 |
+void usage() |
25 |
+{ |
26 |
|
27 |
- |
28 |
+ printf( "usage: libdkimtest [-b<allman|ietf|both>] [-c<r|s|t|u>] [-d<domain>] [-l] [-h] [-i<you@××××××××××.com>] [-q] [-s] [-t] [-v] [-x<expire time>] [-z<hash>] <msgfile> <privkeyfile> <outfile>\n"); |
29 |
+ printf( "-b<standard> allman , ietf or both\n"); |
30 |
+ printf( "-c<canonicalization> r for relaxed [DEFAULT], s - simple, t relaxed/simple, u - simple/relaxed\n"); |
31 |
+ printf( "-d<domain> the domain tag, if not provided it will be determined from the sender/from header\n"); |
32 |
+ printf( "-l include body length tag\n"); |
33 |
+ printf( "-h this help\n"); |
34 |
+ printf( "-i<identity> the identity, if not provided it will not be included\n"); |
35 |
+ printf( "-s sign the message\n"); |
36 |
+ printf( "-t include a timestamp tag\n"); |
37 |
+ printf( "-v verify the message\n"); |
38 |
+ 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"); |
39 |
+ printf( "-z<hash> 1 for sha1, 2 for sha256, 3 for both\n"); |
40 |
+ printf( "-y<selector> the selector tag DEFAULT=MDaemon\n"); |
41 |
+} |
42 |
int main(int argc, char* argv[]) |
43 |
{ |
44 |
int n; |
45 |
@@ -77,7 +92,7 @@ |
46 |
time(&t); |
47 |
|
48 |
opts.nCanon = DKIM_SIGN_RELAXED; |
49 |
- opts.nIncludeBodyLengthTag = 1; |
50 |
+ opts.nIncludeBodyLengthTag = 0; |
51 |
opts.nIncludeQueryMethod = 0; |
52 |
opts.nIncludeTimeStamp = 0; |
53 |
opts.expireTime = t + 604800; // expires in 1 week |
54 |
@@ -92,6 +107,11 @@ |
55 |
int nArgParseState = 0; |
56 |
bool bSign = true; |
57 |
|
58 |
+ if(argc<2){ |
59 |
+ usage(); |
60 |
+ exit(1); |
61 |
+ } |
62 |
+ |
63 |
for( n = 1; n < argc; n++ ) |
64 |
{ |
65 |
if( argv[n][0] == '-' && strlen(argv[n]) > 1 ) |
66 |
@@ -121,14 +141,16 @@ |
67 |
} |
68 |
break; |
69 |
|
70 |
- |
71 |
+ case 'd': |
72 |
+ strncpy(opts.szDomain,(const char*)(argv[n]+2),sizeof(opts.szDomain)-1); |
73 |
+ break; |
74 |
case 'l': // body length tag |
75 |
opts.nIncludeBodyLengthTag = 1; |
76 |
break; |
77 |
|
78 |
|
79 |
case 'h': |
80 |
- printf( "usage: \n" ); |
81 |
+ usage(); |
82 |
return 0; |
83 |
|
84 |
case 'i': // identity |
85 |
@@ -138,7 +160,7 @@ |
86 |
} |
87 |
else |
88 |
{ |
89 |
- strcpy( opts.szIdentity, argv[n] + 2 ); |
90 |
+ strncpy( opts.szIdentity, argv[n] + 2,sizeof(opts.szIdentity)-1 ); |
91 |
} |
92 |
break; |
93 |
|
94 |
@@ -169,6 +191,9 @@ |
95 |
} |
96 |
break; |
97 |
|
98 |
+ case 'y': |
99 |
+ strncpy( opts.szSelector, argv[n]+2, sizeof(opts.szSelector)-1); |
100 |
+ break; |
101 |
|
102 |
case 'z': // sign w/ sha1, sha256 or both |
103 |
opts.nHash = atoi( &argv[n][2] ); |