summaryrefslogtreecommitdiff
path: root/lib/libkeynote
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-05-25 21:42:25 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-05-25 21:42:25 +0000
commit72595d5cb8d24d33c697fa7a2d4eccc3cb60ff9a (patch)
tree3bad14e4209fac155477160b64675df6de54cede /lib/libkeynote
parent7c983533d3b7679ec8a5d6b1ef8508d67b352fda (diff)
Export kn_keycompare() in the API, update the spec and man pages.
Note that the *.1 manpages will all be rolled into a single one soon.
Diffstat (limited to 'lib/libkeynote')
-rw-r--r--lib/libkeynote/HOWTO.add.crypto4
-rw-r--r--lib/libkeynote/TODO3
-rw-r--r--lib/libkeynote/aux.c6
-rw-r--r--lib/libkeynote/doc/keynote-spec408
-rw-r--r--lib/libkeynote/keynote-keygen.19
-rw-r--r--lib/libkeynote/keynote-sign.19
-rw-r--r--lib/libkeynote/keynote-sigver.19
-rw-r--r--lib/libkeynote/keynote-verify.19
-rw-r--r--lib/libkeynote/keynote.19
-rw-r--r--lib/libkeynote/keynote.320
-rw-r--r--lib/libkeynote/keynote.411
-rw-r--r--lib/libkeynote/keynote.h3
-rw-r--r--lib/libkeynote/signature.c4
-rw-r--r--lib/libkeynote/signature.h3
14 files changed, 324 insertions, 183 deletions
diff --git a/lib/libkeynote/HOWTO.add.crypto b/lib/libkeynote/HOWTO.add.crypto
index 16abff224d7..c3b3e2ce244 100644
--- a/lib/libkeynote/HOWTO.add.crypto
+++ b/lib/libkeynote/HOWTO.add.crypto
@@ -1,4 +1,4 @@
-# $OpenBSD: HOWTO.add.crypto,v 1.1 1999/05/23 22:11:04 angelos Exp $
+# $OpenBSD: HOWTO.add.crypto,v 1.2 1999/05/25 21:42:19 angelos Exp $
This document describes how to add support for digital signature algorithms,
hash functions, and ASCII encoding mechanisms in this implementation.
@@ -28,7 +28,7 @@ For a signature algorithm:
the new algorithm's structure for storing a key (use the DSA
code as a guide).
- Similarly for kn_encode_key()
- - In keynote_keycompare(), add code that compares two keys and
+ - In kn_keycompare(), add code that compares two keys and
returns RETURN_TRUE if they are equal, and RETURN_FALSE otherwise.
- In keynote_signverify_assertion, add code that verifies a
signature for the new algorithm.
diff --git a/lib/libkeynote/TODO b/lib/libkeynote/TODO
index 7675ef9adbe..1c6933d3304 100644
--- a/lib/libkeynote/TODO
+++ b/lib/libkeynote/TODO
@@ -1,6 +1,7 @@
-# $OpenBSD: TODO,v 1.1 1999/05/23 22:11:03 angelos Exp $
+# $OpenBSD: TODO,v 1.2 1999/05/25 21:42:20 angelos Exp $
Short term TODOs:
+ - Single manpage for utilities
- More interesting/comprehensive testsuite
- Add the proper RFC reference to the manpages and README
- Write key/signature algorithm draft(s)
diff --git a/lib/libkeynote/aux.c b/lib/libkeynote/aux.c
index 18108c26ea5..aa10ba0d049 100644
--- a/lib/libkeynote/aux.c
+++ b/lib/libkeynote/aux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aux.c,v 1.1 1999/05/23 22:11:04 angelos Exp $ */
+/* $OpenBSD: aux.c,v 1.2 1999/05/25 21:42:20 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
@@ -116,7 +116,7 @@ keynote_in_action_authorizers(void *key, int algorithm)
kl != (struct keylist *) NULL;
kl = kl->key_next)
if (kl->key_alg == alg)
- if (keynote_keycompare(kl->key_key, s, alg) == RESULT_TRUE)
+ if (kn_keycompare(kl->key_key, s, alg) == RESULT_TRUE)
return RESULT_TRUE;
return RESULT_FALSE;
@@ -299,7 +299,7 @@ keynote_find_assertion(void *authorizer, int num, int algorithm)
as = as->as_next)
if ((as->as_authorizer != (void *) NULL) &&
(as->as_signeralgorithm == algorithm))
- if (keynote_keycompare(authorizer, as->as_authorizer, algorithm) ==
+ if (kn_keycompare(authorizer, as->as_authorizer, algorithm) ==
RESULT_TRUE)
if (num-- == 0)
return as;
diff --git a/lib/libkeynote/doc/keynote-spec b/lib/libkeynote/doc/keynote-spec
index f59e9654363..8298e2ebe90 100644
--- a/lib/libkeynote/doc/keynote-spec
+++ b/lib/libkeynote/doc/keynote-spec
@@ -1,5 +1,3 @@
-# $OpenBSD: keynote-spec,v 1.1 1999/05/23 22:11:09 angelos Exp $
-
Network Working Group Matt Blaze
INTERNET DRAFT Joan Feigenbaum
Expires in six months John Ioannidis
@@ -293,7 +291,9 @@ Abstract
Attribute names are of the form:
- <AttributeID> ::= [a-zA-Z_][a-zA-Z0-9_]*
+ <AttributeID>:: {Any string starting with a-z, A-Z, or the
+ underscore character, followed by any number of
+ a-z, A-Z, 0-9, or underscore characters} ;
That is, an <AttributeID> begins with an alphabetic or underscore
character and can be followed by any number of alphanumerics and
@@ -362,10 +362,11 @@ Abstract
For example, an email application might reserve the app_domain
"RFC822-EMAIL" and might use the attributes named "address" (the
email address of a message's sender), "name" (the human name of the
- message sender), and "organization" (the organization name). The
- values of these attributes would be derived in the obvious way from
- the email message headers. The public key of the message's signer
- would be given in the "_ACTION_AUTHORIZERS" attribute.
+ message sender), and any "organization" headers present (the
+ organization name). The values of these attributes would be derived
+ in the obvious way from the email message headers. The public key of
+ the message's signer would be given in the "_ACTION_AUTHORIZERS"
+ attribute.
Note that "RFC822-EMAIL" is a hypothetical example; such a name may
or may not appear in the actual registry with these or different
@@ -377,12 +378,18 @@ Abstract
In the following sections, the notation [X]* means zero or more
repetitions of character string X. The notation [X]+ means one or
- more repetitions of X. Nonterminal grammar symbols are enclosed in
- angled brackets. Quoted strings in grammar productions represent
- terminals.
+ more repetitions of X. The notation <X>* means zero or more
+ repetitions of non-terminal <X>. The notation <X>+ means one or more
+ repetitions of X, whereas <X>? means zero or one repetitions of X.
+ Nonterminal grammar symbols are enclosed in angled brackets. Quoted
+ strings in grammar productions represent terminals.
4.1 Basic Structure
+ <Assertion>:: <VersionField>? <AuthField> <LicenseesField>?
+ <LocalConstantsField>? <ConditionsField>?
+ <CommentField>? <SignatureField>? ;
+
All KeyNote assertions are encoded in ASCII.
KeyNote assertions are divided into sections, called `fields,' that
@@ -423,6 +430,8 @@ Abstract
4.2 Comments
+ <Comment>:: "#" {ASCII characters} ;
+
The octothorp character ("#", ASCII 35 decimal) can be used to
introduce comments. Outside of quoted strings (see Section 4.3), all
characters from the "#" character through the end of the current line
@@ -433,11 +442,13 @@ Abstract
A `string' is a lexical object containing a sequence of characters.
Strings may contain any non-NUL characters, including newlines and
- nonprinting characters. Strings may be given as literals, computed
+ nonprintable characters. Strings may be given as literals, computed
from complex expressions, or dereferenced from attribute names.
4.3.1 String Literals
+ <StringLiteral>:: "\"" {see description below} "\"" ;
+
A string literal directly represents the value of a string. String
literals must be quoted by preceding and following them with the
double-quote character (ASCII 34 decimal).
@@ -487,11 +498,11 @@ Abstract
4.4), and a string concatenation operator. String expressions may be
parenthesized.
- <StrEx> ::= <StrEx> "." <StrEx> /* String concatenation */
- | <StringLiteral> /* Quoted string */
- | "(" <StrEx> ")"
- | <DerefAttribute> /* See Section 4.4 */
- | "$" <StrEx> /* See Section 4.4 */
+ <StrEx>:: <StrEx> "." <StrEx> /* String concatenation */
+ | <StringLiteral> /* Quoted string */
+ | "(" <StrEx> ")"
+ | <DerefAttribute> /* See Section 4.4 */
+ | "$" <StrEx> ; /* See Section 4.4 */
The "$" operator has higher precedence than the "." operator.
@@ -513,7 +524,9 @@ Abstract
Attributes converted to integer and floating point numbers are
represented according to the ANSI C `long' and `float' types,
- respectively.
+ respectively. In particular, integers range from -2147483648 to
+ 2147483647, whilst floats range from 1.17549435E-38F to
+ 3.40282347E+38F.
Any uninitialized attribute has the empty-string value when
dereferenced as a string and the value zero when dereferenced as an
@@ -542,7 +555,7 @@ Abstract
The <DerefAttribute> token is defined as:
- <DerefAttribute> ::= <AttributeID>
+ <DerefAttribute>:: <AttributeID> ;
4.5 Principal Identifiers
@@ -552,8 +565,8 @@ Abstract
cryptographic keys that are used by KeyNote for credential signature
verification.
- <PrincipalIdentifier> ::= <OpaqueID>
- | <KeyID>
+ <PrincipalIdentifier>:: <OpaqueID>
+ | <KeyID> ;
4.5.1 Opaque Principal Identifiers
@@ -561,7 +574,7 @@ Abstract
said to be `opaque.' Opaque identifiers are encoded in assertions as
strings (see Section 4.3):
- <OpaqueID> ::= <StrEx>
+ <OpaqueID>:: <StrEx> ;
Opaque identifier strings should not contain the ":" character.
@@ -571,13 +584,13 @@ Abstract
verify credential signatures, are said to be `cryptographic.'
Cryptographic identifiers are also lexically encoded as strings:
- <KeyID> ::= <StrEx>
+ <KeyID>:: <StrEx> ;
Unlike Opaque Identifiers, however, Cryptographic Identifier strings
have a special form. To be interpreted by KeyNote (for signature
verification), an identifier string should be of the form:
- ALGORITHM:ENCODEDBITS
+ <IDString>:: <ALGORITHM>":"<ENCODEDBITS> ;
"ALGORITHM" is an ASCII substring that describes the algorithms to be
used in interpreting the key's bits. The ALGORITHM identifies the
@@ -609,9 +622,9 @@ Abstract
assertion language under which the assertion was written. The
KeyNote-Version field is of the form
- <VersionField> ::= "KeyNote-Version:" <VersionString>
- <VersionString> ::= <StringLiteral>
- | <IntegerLiteral>
+ <VersionField>:: "KeyNote-Version:" <VersionString> ;
+ <VersionString>:: <StringLiteral>
+ | <IntegerLiteral> ;
where <VersionString> is an ASCII-encoded string. Assertions in
production versions of KeyNote use decimal digits in the version
@@ -629,10 +642,9 @@ Abstract
to make the Licensees field more readable. The Local-Constants field
is of the form:
- <LocalConstantsField> ::= "Local-Constants:" <Assignments>
- <Assignments> ::= /* can be empty */
- | <AttributeID> "=" <StringLiteral>
- | <Assignments> <Assignments>
+ <LocalConstantsField>:: "Local-Constants:" <Assignments> ;
+ <Assignments>:: /* can be empty */
+ | <AttributeID> "=" <StringLiteral> <Assignments> ;
<AttributeID> is an attribute name from the action attribute
namespace as defined in Section 3. The name is available for use as
@@ -653,9 +665,9 @@ Abstract
The Authorizer identifies the Principal issuing the assertion. This
field is of the form
- <AuthField> ::= "Authorizer:" <AuthID>
- <AuthID> ::= <PrincipalIdentifier>
- | <DerefAttribute>
+ <AuthField>:: "Authorizer:" <AuthID> ;
+ <AuthID>:: <PrincipalIdentifier>
+ | <DerefAttribute> ;
The Principal Identifier may be given directly or by reference to the
attribute namespace (as defined in Section 4.4).
@@ -667,23 +679,23 @@ Abstract
authorization can be distributed across several principals through
the use of `and' and threshold constructs. This field is of the form
- <LicenseesField> ::= "Licensees:" <LicenseesExpr>
+ <LicenseesField>:: "Licensees:" <LicenseesExpr> ;
- <LicenseesExpr> ::= /* can be empty */
- | <PrincExpr>
+ <LicenseesExpr>:: /* can be empty */
+ | <PrincExpr> ;
- <PrincExpr> ::= "(" <PrincExpr> ")"
+ <PrincExpr>:: "(" <PrincExpr> ")"
| <PrincExpr> "&&" <PrincExpr>
| <PrincExpr> "||" <PrincExpr>
| <K>"-of(" <PrincList> ")" /* Threshold */
| <PrincipalIdentifier>
- | <DerefAttribute>
+ | <DerefAttribute> ;
- <PrincList> ::= <PrincipalIdentifier>
- | <DerefAttribute>
- | <PrincList> "," <PrincList>
+ <PrincList>:: <PrincipalIdentifier>
+ | <DerefAttribute>
+ | <PrincList> "," <PrincList> ;
- <K> ::= [1-9][0-9]*
+ <K>:: {Decimal number starting with a digit from 1 to 9} ;
The "&&" operator has higher precedence than the "||" operator. <K>
is an ASCII-encoded positive decimal integer. If a <PrincList>
@@ -697,72 +709,72 @@ Abstract
operate on the action attribute set. The Conditions field is of the
form:
- <ConditionsField> ::= "Conditions:" <ConditionsProgram>
-
- <ConditionsProgram> ::= /* Can be empty */
- | <Clause> ";" <ConditionsProgram>
-
- <Clause> ::= <Test> "->" "{" <ConditionsProgram> "}"
- | <Test> "->" <Value>
- | <Test>
-
- <Value> ::= <StrEx>
-
- <Test> ::= <RelExpr>
-
- <RelExpr> ::= "(" <RelExpr> ")" /* Parentheses */
- | <RelExpr> "&&" <RelExpr> /* Logical AND */
- | <RelExpr> "||" <RelExpr> /* Logical OR */
- | "!" <RelExpr> /* Logical NOT */
- | <IntRelExpr>
- | <FloatRelExpr>
- | <StringRelExpr>
- | "true" /* case insensitive */
- | "false" /* case insensitive */
-
- <IntRelExpr> ::= <IntEx> "==" <IntEx>
- | <IntEx> "!=" <IntEx>
- | <IntEx> "<" <IntEx>
- | <IntEx> ">" <IntEx>
- | <IntEx> "<=" <IntEx>
- | <IntEx> ">=" <IntEx>
-
- <FloatRelExpr> ::= <FloatEx> "<" <FloatEx>
- | <FloatEx> ">" <FloatEx>
- | <FloatEx> "<=" <FloatEx>
- | <FloatEx> ">=" <FloatEx>
-
- <StringRelExpr> ::= <StrEx> "==" <StrEx> /* String equality */
- | <StrEx> "!=" <StrEx> /* String inequality */
- | <StrEx> "<" <StrEx> /* Alphanum. comparisons */
- | <StrEx> ">" <StrEx>
- | <StrEx> "<=" <StrEx>
- | <StrEx> ">=" <StrEx>
- | <StrEx> "~=" <RegExpr> /* Regular expr. matching */
-
- <IntEx> ::= <IntEx> "+" <IntEx> /* Integer */
- | <IntEx> "-" <IntEx>
- | <IntEx> "*" <IntEx>
- | <IntEx> "/" <IntEx>
- | <IntEx> "%" <IntEx>
- | <IntEx> "^" <IntEx> /* Exponentiation */
- | "-" <IntEx>
- | "(" <IntEx> ")"
- | <IntegerLiteral>
- | "@" <StrEx>
-
- <FloatEx> ::= <FloatEx> "+" <FloatEx> /* Floating point */
- | <FloatEx> "-" <FloatEx>
- | <FloatEx> "*" <FloatEx>
- | <FloatEx> "/" <FloatEx>
- | <FloatEx> "^" <FloatEx> /* Exponentiation */
- | "-" <FloatEx>
- | "(" <FloatEx> ")"
- | <FloatLiteral>
- | "&" <StrEx>
-
- <IntegerLiteral> ::= [0-9]+
- <FloatLiteral> ::= [0-9]+\.[0-9]+
+ <ConditionsField>:: "Conditions:" <ConditionsProgram> ;
+
+ <ConditionsProgram>:: /* Can be empty */
+ | <Clause> ";" <ConditionsProgram> ;
+
+ <Clause>:: <Test> "->" "{" <ConditionsProgram> "}"
+ | <Test> "->" <Value>
+ | <Test> ;
+
+ <Value>:: <StrEx> ;
+
+ <Test>:: <RelExpr> ;
+
+ <RelExpr>:: "(" <RelExpr> ")" /* Parentheses */
+ | <RelExpr> "&&" <RelExpr> /* Logical AND */
+ | <RelExpr> "||" <RelExpr> /* Logical OR */
+ | "!" <RelExpr> /* Logical NOT */
+ | <IntRelExpr>
+ | <FloatRelExpr>
+ | <StringRelExpr>
+ | "true" /* case insensitive */
+ | "false" ; /* case insensitive */
+
+ <IntRelExpr>:: <IntEx> "==" <IntEx>
+ | <IntEx> "!=" <IntEx>
+ | <IntEx> "<" <IntEx>
+ | <IntEx> ">" <IntEx>
+ | <IntEx> "<=" <IntEx>
+ | <IntEx> ">=" <IntEx> ;
+
+ <FloatRelExpr>:: <FloatEx> "<" <FloatEx>
+ | <FloatEx> ">" <FloatEx>
+ | <FloatEx> "<=" <FloatEx>
+ | <FloatEx> ">=" <FloatEx> ;
+
+ <StringRelExpr>:: <StrEx> "==" <StrEx> /* String equality */
+ | <StrEx> "!=" <StrEx> /* String inequality */
+ | <StrEx> "<" <StrEx> /* Alphanum. comparisons */
+ | <StrEx> ">" <StrEx>
+ | <StrEx> "<=" <StrEx>
+ | <StrEx> ">=" <StrEx>
+ | <StrEx> "~=" <RegExpr> ; /* Reg. expr. matching */
+
+ <IntEx>:: <IntEx> "+" <IntEx> /* Integer */
+ | <IntEx> "-" <IntEx>
+ | <IntEx> "*" <IntEx>
+ | <IntEx> "/" <IntEx>
+ | <IntEx> "%" <IntEx>
+ | <IntEx> "^" <IntEx> /* Exponentiation */
+ | "-" <IntEx>
+ | "(" <IntEx> ")"
+ | <IntegerLiteral>
+ | "@" <StrEx> ;
+
+ <FloatEx>:: <FloatEx> "+" <FloatEx> /* Floating point */
+ | <FloatEx> "-" <FloatEx>
+ | <FloatEx> "*" <FloatEx>
+ | <FloatEx> "/" <FloatEx>
+ | <FloatEx> "^" <FloatEx> /* Exponentiation */
+ | "-" <FloatEx>
+ | "(" <FloatEx> ")"
+ | <FloatLiteral>
+ | "&" <StrEx> ;
+
+ <IntegerLiteral>:: {Decimal number of at least one digit} ;
+ <FloatLiteral>:: <IntegerLiteral>"."<IntegerLiteral> ;
<StringLiteral> is a quoted string as defined in Section 4.3
<AttributeID> is defined in Section 3.
@@ -777,6 +789,14 @@ Abstract
Operators in the same precedence class are evaluated left-to-right.
+ Note the inability to test for floating point equality, as most
+ floating point implementations (hardware or otherwise) do not
+ guarantee accurate equality testing.
+
+ Also note that integer and floating point expressions can only be
+ used within clauses of condition fields, but in no other KeyNote
+ field.
+
The keywords "true" and "false" are not reserved; they can be used as
attribute or principal identifier names (although this practice makes
assertions difficult to understand and is discouraged).
@@ -797,13 +817,13 @@ Abstract
The Comment field allows assertions to be annotated with information
describing their purpose. It is of the form
- <CommentField> ::= "Comment:" <text>
+ <CommentField>:: "Comment:" <text> ;
No interpretation of the contents of this field is performed by
KeyNote. Note that this is one of two mechanisms for including
comments in KeyNote assertions; comments can also be inserted
anywhere in an assertion's body by preceeding them with the "#"
- character.
+ character (except inside string literals).
4.6.7 The Signature Field
@@ -811,13 +831,13 @@ Abstract
encoded digital signature of the principal identified in the
Authorizer field. The Signature field is of the form:
- <SignatureField> ::= "Signature:" <Signature>
+ <SignatureField>:: "Signature:" <Signature> ;
- <Signature> ::= <StrEx>
+ <Signature>:: <StrEx> ;
The <Signature> string should be of the form:
- ALGORITHM:ENCODEDBITS
+ <IDString>:: <ALGORITHM>":"<ENCODEDBITS> ;
The formats of the "ALGORITHM" and "ENCODEDBITS" substrings are as
described for Cryptographic Principal Identifiers in Section 4.4.2
@@ -1149,8 +1169,13 @@ Abstract
down' approach starting at the POLICY assertions, and still others
might employ other heuristics entirely.
+ Implementations are encouraged to employ mechanisms for recording
+ exceptions (such as division by zero or syntax error), and reporting
+ them to the invoking application if requested. Such mechanisms are
+ outside the scope of this document.
+
- 6. Examples
+6. Examples
In this section, we give examples of KeyNote assertions that might be
used in hypothetical applications. These examples are intended
@@ -1435,13 +1460,158 @@ Abstract
security implications for any applications in which it is used.
-9. Acknowledgments
+9. IANA Considerations
+
+ This document contains three identifiers to be maintained by the
+ IANA. This section explains the criteria to be used by the IANA to
+ assign additional identifiers in each of these lists.
+
+9.1 app_domain Identifiers
+
+ The only requirement on IANA on allocation of these identifiers is
+ that they be unique strings. These strings are case-sensitive for
+ KeyNote purposes, however it is strongly recommended that IANA
+ assigns different capitalizations of the same string only to the same
+ organization.
+
+
+9.2 Public Key Format Identifiers
+
+ These strings uniquely identify a public key algorithm as used in the
+ KeyNote system for representing keys. Requests for assignment of new
+ identifiers must be accompanied by an RFC-style document which
+ describes the details of this encoding. Example strings are "rsa-
+ hex:" and "dsa-base64:". These strings are case-insensitive.
+
+9.3 Signature Algorithm Identifiers
+
+ These strings uniquely identify a public key algorithm as used in the
+ KeyNote system for representing public key signatures. Requests for
+ assignment of new identifiers must be accompanied by an RFC-style
+ document which describes the details of this encoding. Example
+ strings are "sig-rsa-md5-hex:" and "sig-dsa-sha1-base64:". Note that
+ all such strings must begin with the prefix "sig-". These strings
+ are case-insensitive.
+
+
+A. Acknowledgments
We thank Lorrie Faith Cranor (AT&T Labs - Research) and Jonathan M.
Smith (University of Pennsylvania) for their suggestions and comments
on earlier versions of this.
+B. Full BNF (alphabetical order)
+
+ <ALGORITHM>:: {see section 4.4.2} ;
+
+ <Assertion>:: <VersionField>? <AuthField> <LicenseesField>?
+ <LocalConstantsField>? <ConditionsField>?
+ <CommentField>? <SignatureField>? ;
+
+ <Assignments>:: "" | <AttributeID> "=" <StringLiteral> <Assignments>
+ ;
+
+ <AttributeID>:: {Any string starting with a-z, A-Z, or the
+ underscore character, followed by any number of
+ a-z, A-Z, 0-9, or underscore characters} ;
+
+ <AuthField>:: "Authorizer:" <AuthID> ;
+
+ <AuthID>:: <PrincipalIdentifier> | <DerefAttribute> ;
+
+ <Clause>:: <Test> "->" "{" <ConditionsProgram> "}"
+ | <Test> "->" <Value> | <Test> ;
+
+ <Comment>:: "#" {ASCII characters} ;
+
+ <CommentField>:: "Comment:" {Free-form text} ;
+
+ <ConditionsField>:: "Conditions:" <ConditionsProgram> ;
+
+ <ConditionsProgram>:: "" | <Clause> ";" <ConditionsProgram> ;
+
+ <DerefAttribute>:: <AttributeID> ;
+
+ <ENCODEDBITS>:: {see section 4.4.2} ;
+
+ <FloatEx>:: <FloatEx> "+" <FloatEx> | <FloatEx> "-" <FloatEx>
+ | <FloatEx> "*" <FloatEx> | <FloatEx> "/" <FloatEx>
+ | <FloatEx> "^" <FloatEx> | "-" <FloatEx>
+ | "(" <FloatEx> ")" | <FloatLiteral> | "&" <StrEx> ;
+
+ <FloatRelExpr>:: <FloatEx> "<" <FloatEx> | <FloatEx> ">" <FloatEx>
+ | <FloatEx> "<=" <FloatEx>
+ | <FloatEx> ">=" <FloatEx> ;
+
+ <FloatLiteral>:: <IntegerLiteral>"."<IntegerLiteral> ;
+
+ <IDString>:: <ALGORITHM>":"<ENCODEDBITS> ;
+
+ <IntegerLiteral>:: {Decimal number of at least one digit} ;
+
+ <IntEx>:: <IntEx> "+" <IntEx> | <IntEx> "-" <IntEx>
+ | <IntEx> "*" <IntEx> | <IntEx> "/" <IntEx>
+ | <IntEx> "%" <IntEx> | <IntEx> "^" <IntEx>
+ | "-" <IntEx> | "(" <IntEx> ")" | <IntegerLiteral>
+ | "@" <StrEx> ;
+
+ <IntRelExpr>:: <IntEx> "==" <IntEx> | <IntEx> "!=" <IntEx>
+ | <IntEx> "<" <IntEx> | <IntEx> ">" <IntEx>
+ | <IntEx> "<=" <IntEx> | <IntEx> ">=" <IntEx> ;
+
+ <K>:: {Decimal number starting with a digit from 1 to 9} ;
+
+ <KeyID>:: <StrEx> ;
+
+ <LicenseesExpr>:: "" | <PrincExpr> ;
+
+ <LicenseesField>:: "Licensees:" <LicenseesExpr> ;
+
+ <LocalConstantsField>:: "Local-Constants:" <Assignments> ;
+
+ <OpaqueID>:: <StrEx> ;
+
+ <PrincExpr>:: "(" <PrincExpr> ")" | <PrincExpr> "&&" <PrincExpr>
+ | <PrincExpr> "||" <PrincExpr>
+ | <K>"-of(" <PrincList> ")" | <PrincipalIdentifier>
+ | <DerefAttribute> ;
+
+ <PrincipalIdentifier>:: <OpaqueID> | <KeyID> ;
+
+ <PrincList>:: <PrincipalIdentifier> | <DerefAttribute>
+ | <PrincList> "," <PrincList> ;
+
+ <RegExpr>:: {POSIX 1003.2 Regular Expression}
+
+ <RelExpr>:: "(" <RelExpr> ")" | <RelExpr> "&&" <RelExpr>
+ | <RelExpr> "||" <RelExpr> | "!" <RelExpr>
+ | <IntRelExpr> | <FloatRelExpr> | <StringRelExpr>
+ | "true" | "false" ;
+
+ <Signature>:: <StrEx> ;
+
+ <SignatureField>:: "Signature:" <Signature> ;
+
+ <StrEx>:: <StrEx> "." <StrEx> | <StringLiteral> | "(" <StrEx> ")"
+ | <DerefAttribute> | "$" <StrEx> ;
+
+ <StringLiteral>:: {see section 4.3.1} ;
+
+ <StringRelExpr>:: <StrEx> "==" <StrEx> | <StrEx> "!=" <StrEx>
+ | <StrEx> "<" <StrEx> | <StrEx> ">" <StrEx>
+ | <StrEx> "<=" <StrEx> | <StrEx> ">=" <StrEx>
+ | <StrEx> "~=" <RegExpr> ;
+
+ <Test>:: <RelExpr> ;
+
+ <Value>:: <StrEx> ;
+
+ <VersionField>:: "KeyNote-Version:" <VersionString> ;
+
+ <VersionString>:: <StringLiteral> | <IntegerLiteral> ;
+
+
References
[BFL96] M. Blaze, J. Feigenbaum, J. Lacy. Decentralized Trust
@@ -1477,6 +1647,7 @@ References
Communications of the ACM, v21n2. pp 120-126. February
1978.
+
Contacts
Comments about this document should be discussed on the
@@ -1501,6 +1672,7 @@ Contacts
Philadelphia, Pennsylvania 19104-6389
Email: angelos@dsl.cis.upenn.edu
+
Full Copyright Statement
Copyright (C) The Internet Society (1999). All Rights Reserved.
@@ -1560,3 +1732,9 @@ Full Copyright Statement
+
+
+
+
+
+
diff --git a/lib/libkeynote/keynote-keygen.1 b/lib/libkeynote/keynote-keygen.1
index df9b021490a..925f7021258 100644
--- a/lib/libkeynote/keynote-keygen.1
+++ b/lib/libkeynote/keynote-keygen.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: keynote-keygen.1,v 1.2 1999/05/24 01:50:03 angelos Exp $
+.\" $OpenBSD: keynote-keygen.1,v 1.3 1999/05/25 21:42:21 angelos Exp $
.\"
.\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
.\"
@@ -36,13 +36,6 @@
.Op print-offset
.Op print-length
.Sh DESCRIPTION
-For details on
-.Nm KeyNote ,
-see the web page
-.Bd -literal -offset indent
- http://www.cis.upenn.edu/~keynote
-.Ed
-.Pp
.Nm keynote-keygen
creates a public/private key of size
.Fa KeySize ,
diff --git a/lib/libkeynote/keynote-sign.1 b/lib/libkeynote/keynote-sign.1
index ef01cfd4de1..afb6c1b0bd0 100644
--- a/lib/libkeynote/keynote-sign.1
+++ b/lib/libkeynote/keynote-sign.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: keynote-sign.1,v 1.3 1999/05/24 01:53:58 angelos Exp $
+.\" $OpenBSD: keynote-sign.1,v 1.4 1999/05/25 21:42:21 angelos Exp $
.\"
.\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
.\"
@@ -36,13 +36,6 @@ assertions
.Ar AssertionFile
.Ar PrivateKeyFile
.Sh DESCRIPTION
-For details on
-.Nm KeyNote ,
-see the web page
-.Bd -literal -offset indent
- http://www.cis.upenn.edu/~keynote
-.Ed
-.Pp
.Nm keynote-sign
reads the assertion contained in
.Fa AssertionFile
diff --git a/lib/libkeynote/keynote-sigver.1 b/lib/libkeynote/keynote-sigver.1
index be52853ca2a..dca8192ab9d 100644
--- a/lib/libkeynote/keynote-sigver.1
+++ b/lib/libkeynote/keynote-sigver.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: keynote-sigver.1,v 1.3 1999/05/24 01:53:58 angelos Exp $
+.\" $OpenBSD: keynote-sigver.1,v 1.4 1999/05/25 21:42:21 angelos Exp $
.\"
.\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
.\"
@@ -33,13 +33,6 @@ assertions
.Nm keynote sigver
.Op AssertionFile
.Sh DESCRIPTION
-For details on
-.Nm KeyNote ,
-see the web page
-.Bd -literal -offset indent
- http://www.cis.upenn.edu/~keynote
-.Ed
-.Pp
.Nm keynote-sigver
reads the assertion contained in
.Fa AssertionFile
diff --git a/lib/libkeynote/keynote-verify.1 b/lib/libkeynote/keynote-verify.1
index e7b19633cdb..a122e813d35 100644
--- a/lib/libkeynote/keynote-verify.1
+++ b/lib/libkeynote/keynote-verify.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: keynote-verify.1,v 1.3 1999/05/24 01:53:58 angelos Exp $
+.\" $OpenBSD: keynote-verify.1,v 1.4 1999/05/25 21:42:21 angelos Exp $
.\"
.\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
.\"
@@ -39,13 +39,6 @@ assertions
.Op Fl l Ar file
.Op Ar file ...
.Sh DESCRIPTION
-For details on
-.Nm KeyNote ,
-see the web page
-.Bd -literal -offset indent
- http://www.cis.upenn.edu/~keynote
-.Ed
-.Pp
For each operand that names a
.A file ,
.Nm keynote-verify
diff --git a/lib/libkeynote/keynote.1 b/lib/libkeynote/keynote.1
index 7ec36902dce..580446c3667 100644
--- a/lib/libkeynote/keynote.1
+++ b/lib/libkeynote/keynote.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: keynote.1,v 1.1 1999/05/24 01:54:15 angelos Exp $
+.\" $OpenBSD: keynote.1,v 1.2 1999/05/25 21:42:22 angelos Exp $
.\"
.\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
.\"
@@ -34,13 +34,6 @@ operations
.Op sign|verify|sigver|keygen
.Op ...
.Sh DESCRIPTION
-For details on
-.Nm KeyNote ,
-see the web page
-.Bd -literal -offset indent
- http://www.cis.upenn.edu/~keynote
-.Ed
-.Pp
.Nm keynote
does the operation indicated by the first argument. For more details on the
specific flags for each operation, see the respective manpages (
diff --git a/lib/libkeynote/keynote.3 b/lib/libkeynote/keynote.3
index cd9596883c5..d7f97e6f7b0 100644
--- a/lib/libkeynote/keynote.3
+++ b/lib/libkeynote/keynote.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: keynote.3,v 1.2 1999/05/24 01:50:04 angelos Exp $
+.\" $OpenBSD: keynote.3,v 1.3 1999/05/25 21:42:22 angelos Exp $
.\"
.\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
.\"
@@ -79,6 +79,8 @@ struct keynote_binary
.Ft char **
.Fn kn_read_asserts "char *array" "int arraylen" "int *numassertions"
.Ft int
+.Fn kn_keycompare "void *key1" "void *key2" "int algorithm"
+.Ft int
.Fn kn_encode_base64 "unsigned char const *src" "unsigned int srclen" "char *dst" "unsigned int dstlen"
.Ft int
.Fn kn_decode_base64 "char const *src" "unsigned char *dst" "unsigned int dstlen"
@@ -96,13 +98,6 @@ struct keynote_binary
.Fn kn_verify_assertion "char *assertion" "int len"
.Fd Link options: -lkeynote -lm -lcrypto
.Sh DESCRIPTION
-For details on
-.Nm KeyNote ,
-see the web page
-.Bd -literal -offset indent
- http://www.cis.upenn.edu/~keynote
-.Ed
-.Pp
.Va keynote_errno
contains an error code if some library call failed. Failed calls
return -1 (if their return value is integer), or
@@ -440,6 +435,15 @@ if
was
.Dv NULL .
.Pp
+.Fn kn_keycompare
+compares
+.Fa key1
+and
+.Fa key2
+(which must be of the same
+.Fa algorithm )
+and returns 1 if equal and 0 otherwise.
+.Pp
.Fn kn_query
takes as arguments a list of action attributes in
.Fa env ,
diff --git a/lib/libkeynote/keynote.4 b/lib/libkeynote/keynote.4
index 64565563432..42cf4a0f74d 100644
--- a/lib/libkeynote/keynote.4
+++ b/lib/libkeynote/keynote.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: keynote.4,v 1.2 1999/05/24 01:50:04 angelos Exp $
+.\" $OpenBSD: keynote.4,v 1.3 1999/05/25 21:42:22 angelos Exp $
.\"
.\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
.\"
@@ -31,14 +31,7 @@
.Fd #include <keynote.h>
.Fd Link options: -lkeynote -lm -lcrypto
.Sh DESCRIPTION
-For more details on
-.Nm KeyNote ,
-see the web page
-.Bd -literal -offset indent
- http://www.cis.upenn.edu/~keynote
-.Ed
-.Pp
-Additional details on the API and the various tools are given in the
+Details on the API and the various tools are given in the
man pages listed at the end of this manual.
.Pp
Trust management, introduced in the PolicyMaker system, is a unified
diff --git a/lib/libkeynote/keynote.h b/lib/libkeynote/keynote.h
index 2ae97f85919..f1df1a334ca 100644
--- a/lib/libkeynote/keynote.h
+++ b/lib/libkeynote/keynote.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: keynote.h,v 1.1 1999/05/23 22:11:04 angelos Exp $ */
+/* $OpenBSD: keynote.h,v 1.2 1999/05/25 21:42:23 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
@@ -177,6 +177,7 @@ int kn_query(struct environment *, char **, int, char **, int *, int,
/* Aux. routines */
char **kn_read_asserts(char *, int, int *);
+int kn_keycompare(void *, void *, int);
/* ASCII-encoding API */
int kn_encode_base64(unsigned char const *, unsigned int, char *,
diff --git a/lib/libkeynote/signature.c b/lib/libkeynote/signature.c
index 3533d8ee41f..c003c8456bd 100644
--- a/lib/libkeynote/signature.c
+++ b/lib/libkeynote/signature.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signature.c,v 1.1 1999/05/23 22:11:06 angelos Exp $ */
+/* $OpenBSD: signature.c,v 1.2 1999/05/25 21:42:23 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
@@ -644,7 +644,7 @@ kn_decode_key(struct keynote_deckey *dc, char *key, int keytype)
* RESULT_FALSE otherwise.
*/
int
-keynote_keycompare(void *key1, void *key2, int algorithm)
+kn_keycompare(void *key1, void *key2, int algorithm)
{
#ifdef CRYPTO
DSA *p1, *p2;
diff --git a/lib/libkeynote/signature.h b/lib/libkeynote/signature.h
index d2f8faae092..03d23d825d7 100644
--- a/lib/libkeynote/signature.h
+++ b/lib/libkeynote/signature.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signature.h,v 1.1 1999/05/23 22:11:06 angelos Exp $ */
+/* $OpenBSD: signature.h,v 1.2 1999/05/25 21:42:23 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
@@ -59,6 +59,5 @@
int keynote_get_key_algorithm(char *, int *, int *);
int keynote_sigverify_assertion(struct assertion *);
-int keynote_keycompare(void *, void *, int);
void keynote_free_key(void *, int);
#endif /* __SIGNATURE_H__ */