Project

General

Profile

SQLite HOWTO » History » Version 6

Martin Willi, 29.06.2008 13:56
added identity examples

1 1 Martin Willi
= SQLite HOWTO =
2 2 Martin Willi
3 3 Martin Willi
SQLite tables defined in [browser:trunk/testing/hosts/default/etc/ipsec.d/tables.sql tables.sql]
4 3 Martin Willi
5 3 Martin Willi
== TABLE identities ==
6 3 Martin Willi
7 3 Martin Willi
'''type''' defined in [browser:trunk/src/libstrongswan/utils/identification.h#L58 identification.h]
8 3 Martin Willi
9 3 Martin Willi
||  0||ID_ANY             ||matches any id                      ||right=''%any''                                            ||
10 3 Martin Willi
||  1||ID_IPV4_ADDR       ||IPv4 address                        ||right=''192.168.0.1''                                     ||
11 3 Martin Willi
||  2||ID_FQDN            ||fully qualified domain name         ||right=''@moon.strongswan.org''                            ||
12 3 Martin Willi
||  3||ID_RFC822_ADDR     ||RFC822 email address                ||right=''carol@strongswan.org''                            ||
13 3 Martin Willi
||  5||ID_IPV6_ADDR       ||IPv6 address                        ||right=''fec0::1''                                         ||
14 3 Martin Willi
||  9||ID_DER_ASN1_DN     ||ASN.1 distinguished name            ||right=''C=CH, O=Linux strongSwan, CN=moon.strongswan.org''||
15 3 Martin Willi
|| 11||ID_KEY_ID          ||opaque octet string                 ||right=''@#                                                ||
16 3 Martin Willi
||202||ID_PUBKEY_INFO_SHA1||SHA-1 hash over subjectPublicKeyInfo||                                                          ||
17 3 Martin Willi
||203||ID_PUBKEY_SHA1     ||SHA-1 hash over subjectPublicKey    ||                                                          ||
18 3 Martin Willi
19 6 Martin Willi
'''ID_ANY''': id2sql "%any"
20 1 Martin Willi
21 6 Martin Willi
{{{
22 6 Martin Willi
INSERT INTO identities (
23 6 Martin Willi
  type, data
24 6 Martin Willi
) VALUES (
25 6 Martin Willi
  0, X''
26 6 Martin Willi
 );
27 6 Martin Willi
}}}
28 1 Martin Willi
29 6 Martin Willi
'''ID_IPV4_ADDR''': id2sql "192.168.0.1"
30 6 Martin Willi
31 1 Martin Willi
{{{
32 6 Martin Willi
INSERT INTO identities (
33 6 Martin Willi
  type, data
34 6 Martin Willi
) VALUES (
35 6 Martin Willi
  1, X'c0a80001'
36 6 Martin Willi
 );
37 6 Martin Willi
}}}
38 6 Martin Willi
39 6 Martin Willi
'''ID_FQDN''': id2sql "@moon.strongswan.org"
40 6 Martin Willi
41 6 Martin Willi
{{{
42 6 Martin Willi
INSERT INTO identities (
43 6 Martin Willi
  type, data
44 6 Martin Willi
) VALUES (
45 6 Martin Willi
  2, X'6d6f6f6e2e7374726f6e677377616e2e6f7267'
46 6 Martin Willi
 );
47 6 Martin Willi
}}}
48 6 Martin Willi
49 6 Martin Willi
'''ID_RFC822_ADDR''': id2sql "carol@strongswan.org"
50 6 Martin Willi
51 6 Martin Willi
{{{
52 6 Martin Willi
INSERT INTO identities (
53 6 Martin Willi
  type, data
54 6 Martin Willi
) VALUES (
55 6 Martin Willi
  3, X'6361726f6c407374726f6e677377616e2e6f7267'
56 6 Martin Willi
 );
57 6 Martin Willi
}}}
58 6 Martin Willi
59 6 Martin Willi
'''ID_IPV6_ADDR''': id2sql "fec0::1"
60 6 Martin Willi
61 6 Martin Willi
{{{
62 6 Martin Willi
INSERT INTO identities (
63 6 Martin Willi
  type, data
64 6 Martin Willi
) VALUES (
65 6 Martin Willi
  5, X'fec00000000000000000000000000001'
66 6 Martin Willi
 );
67 6 Martin Willi
}}}
68 6 Martin Willi
69 6 Martin Willi
'''ID_DER_ASN1_DN''': id2sql "C=CH, O=Linux strongSwan, CN=moon.strongswan.org"
70 6 Martin Willi
71 6 Martin Willi
{{{
72 6 Martin Willi
INSERT INTO identities (
73 6 Martin Willi
  type, data
74 6 Martin Willi
) VALUES (
75 6 Martin Willi
  9, X'3046310b300906035504061302434831193017060355040a13104c696e7578207374726f6e675377616e311c301a060355040313136d6f6f6e2e7374726f6e677377616e2e6f7267'
76 6 Martin Willi
 );
77 3 Martin Willi
}}}
78 3 Martin Willi
79 3 Martin Willi
== TABLE private_keys ==
80 3 Martin Willi
81 3 Martin Willi
'''type''' defined in [browser:trunk/src/libstrongswan/credentials/keys/public_key.h#L37 public_key.h]
82 3 Martin Willi
83 3 Martin Willi
||1||KEY_RSA  ||RSA key in PKCS!#1 format     ||
84 3 Martin Willi
||2||KEY_ECDSA||ECDSA key in ANSI X9.62 format||
85 3 Martin Willi
86 3 Martin Willi
== TABLE certificates ==
87 3 Martin Willi
88 3 Martin Willi
'''type''' defined in [browser:trunk/src/libstrongswan/credentials/certificates/certificate.h#L35 certificate.h]
89 3 Martin Willi
90 3 Martin Willi
||1||CERT_X509          ||X.509 certificate                ||
91 3 Martin Willi
||2||CERT_X509_CRL      ||X.509 certificate revocation list||
92 3 Martin Willi
||5||CERT_X509_AC       ||X.509 attribute certificate      ||
93 3 Martin Willi
||6||CERT_TRUSTED_PUBKEY||trusted public key               ||
94 4 Martin Willi
95 4 Martin Willi
'''keytype''' defined in [browser:trunk/src/libstrongswan/credentials/keys/public_key.h#L37 public_key.h]
96 4 Martin Willi
97 4 Martin Willi
== TABLE shared_secrets ==
98 4 Martin Willi
99 4 Martin Willi
'''type''' defined in [browser:trunk/src/libstrongswan/credentials/keys/shared_key.h#L33 shared_key.h]
100 4 Martin Willi
101 4 Martin Willi
||1||SHARED_IKE||: PSK <secret>                       ||
102 4 Martin Willi
||2||SHARED_EAP||: EAP <secret>                       ||
103 3 Martin Willi
||3||SHARED_PRIVATE_KEY_PASS||: RSA <keyfile> <secret>||
104 3 Martin Willi
||4||SHARED_PIN||: PIN <secret>                       ||
105 3 Martin Willi
106 1 Martin Willi
== TABLE peer_configs ==
107 4 Martin Willi
108 3 Martin Willi
'''auth_method''' defined in [browser:trunk/src/charon/config/peer_cfg.h#L87 peer_cfg.h]
109 1 Martin Willi
110 4 Martin Willi
||1||CONF_AUTH_PUBKEY||authentication using public key       ||authby=''rsasig'', authby=''ecdsasig''||
111 4 Martin Willi
||2||CONF_AUTH_PSK   ||authentication using pre-shared secret||authby=''psk''                       ||
112 4 Martin Willi
||3||CONF_AUTH_EAP   ||authentication using EAP              ||authby=''eap''                       ||
113 4 Martin Willi
114 4 Martin Willi
== TABLE traffic_selectors ==
115 4 Martin Willi
116 4 Martin Willi
'''type''' defined in [browser:trunk/src/charon/config/traffic_selector.h#L37 traffic_selector.h]
117 1 Martin Willi
118 1 Martin Willi
||7||TS_IPV4_ADDR_RANGE||
119 1 Martin Willi
||8||TS_IPV6_ADDR_RANGE||