~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e2edda6
)
Copy attributes from parameter keys.
author
mdw
<mdw>
Wed, 21 Apr 2004 00:38:34 +0000
(
00:38
+0000)
committer
mdw
<mdw>
Wed, 21 Apr 2004 00:38:34 +0000
(
00:38
+0000)
key.1
patch
|
blob
|
blame
|
history
keyutil.c
patch
|
blob
|
blame
|
history
diff --git
a/key.1
b/key.1
index
1b6c7e5
..
5c7bee6
100644
(file)
--- a/
key.1
+++ b/
key.1
@@
-267,7
+267,8
@@
key-generation algorithms have a subsidiary key size.
.TP
.BI "\-p, \-\-parameters " tag
Selects a key containing parameter values to copy. Not all
.TP
.BI "\-p, \-\-parameters " tag
Selects a key containing parameter values to copy. Not all
-key-generation algorithms allow the use of shared parameters.
+key-generation algorithms allow the use of shared parameters. A new key
+also inherits attributes from its parameter key.
.TP
.BI "\-e, \-\-expire " expire
The expiry date for the generated key. This may be the string
.TP
.BI "\-e, \-\-expire " expire
The expiry date for the generated key. This may be the string
diff --git
a/keyutil.c
b/keyutil.c
index
0251b43
..
13b8784
100644
(file)
--- a/
keyutil.c
+++ b/
keyutil.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: keyutil.c,v 1.2
4 2004/04/08 01:36:15
mdw Exp $
+ * $Id: keyutil.c,v 1.2
5 2004/04/21 00:38:22
mdw Exp $
*
* Simple key manager program
*
*
* Simple key manager program
*
@@
-248,6
+248,8
@@
static void mpkey(key_data *kd, const char *tag, mp *m, unsigned f)
static int copyparam(keyopts *k, const char **pp)
{
key_filter kf;
static int copyparam(keyopts *k, const char **pp)
{
key_filter kf;
+ key_attriter i;
+ const char *n, *v;
/* --- Quick check if no parameters supplied --- */
/* --- Quick check if no parameters supplied --- */
@@
-271,6
+273,14
@@
static int copyparam(keyopts *k, const char **pp)
kf.m = KF_CATMASK;
if (!key_copy(&k->k->k, &k->p->k, &kf))
die(EXIT_FAILURE, "unexpected failure while copying parameters");
kf.m = KF_CATMASK;
if (!key_copy(&k->k->k, &k->p->k, &kf))
die(EXIT_FAILURE, "unexpected failure while copying parameters");
+
+ /* --- Copy over attributes --- */
+
+ for (key_mkattriter(&i, k->p); key_nextattr(&i, &n, &v); )
+ key_putattr(k->kf, k->k, n, v);
+
+ /* --- Done --- */
+
return (1);
}
return (1);
}