-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ Module: Known_Hosts | |
|
||
Author: Raphaël Pinson <[email protected]> | ||
|
||
About: Reference | ||
This lens manages OpenSSH's known_hosts files. See `man 8 sshd` for reference. | ||
|
||
About: License | ||
This file is licenced under the LGPL v2+, like the rest of Augeas. | ||
|
||
|
@@ -26,17 +29,35 @@ module Known_Hosts = | |
|
||
autoload xfm | ||
|
||
|
||
(* View: marker | ||
The marker is optional, but if it is present then it must be one of | ||
“@cert-authority”, to indicate that the line contains a certification | ||
authority (CA) key, or “@revoked”, to indicate that the key contained | ||
on the line is revoked and must not ever be accepted. | ||
Only one marker should be used on a key line. | ||
*) | ||
let marker = [ key /@(revoked|cert-authority)/ . Sep.space ] | ||
|
||
|
||
(* View: type | ||
Bits, exponent, and modulus are taken directly from the RSA host key; | ||
they can be obtained, for example, from /etc/ssh/ssh_host_key.pub. | ||
The optional comment field continues to the end of the line, and is not used. | ||
*) | ||
let type = [ label "type" . store Rx.neg1 ] | ||
|
||
|
||
(* View: entry | ||
A known_hosts entry *) | ||
let entry = | ||
let alias = [ label "alias" . store Rx.neg1 ] | ||
in [ Util.indent . seq "entry" . store Rx.neg1 | ||
let alias = [ label "alias" . store Rx.neg1 ] | ||
in let key = [ label "key" . store Rx.neg1 ] | ||
in [ Util.indent . seq "entry" . marker? | ||
. store Rx.neg1 | ||
. (Sep.comma . Build.opt_list alias Sep.comma)? | ||
. Sep.space | ||
. [ label "type" . store Rx.no_spaces ] | ||
. Sep.space | ||
. [ label "key" . store Rx.no_spaces ] | ||
. Util.eol ] | ||
. Sep.space . type . Sep.space . key | ||
. Util.comment_or_eol ] | ||
|
||
(* View: lns | ||
The known_hosts lens *) | ||
|