encryption.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. //go:build linux
  2. package overlay
  3. import (
  4. "bytes"
  5. "encoding/binary"
  6. "encoding/hex"
  7. "fmt"
  8. "hash/fnv"
  9. "net"
  10. "strconv"
  11. "sync"
  12. "syscall"
  13. "github.com/docker/docker/libnetwork/drivers/overlay/overlayutils"
  14. "github.com/docker/docker/libnetwork/iptables"
  15. "github.com/docker/docker/libnetwork/ns"
  16. "github.com/docker/docker/libnetwork/types"
  17. "github.com/sirupsen/logrus"
  18. "github.com/vishvananda/netlink"
  19. )
  20. /*
  21. Encrypted overlay networks use IPsec in transport mode to encrypt and
  22. authenticate the VXLAN UDP datagrams. This driver implements a bespoke control
  23. plane which negotiates the security parameters for each peer-to-peer tunnel.
  24. IPsec Terminology
  25. - ESP: IPSec Encapsulating Security Payload
  26. - SPI: Security Parameter Index
  27. - ICV: Integrity Check Value
  28. - SA: Security Association https://en.wikipedia.org/wiki/IPsec#Security_association
  29. Developer documentation for Linux IPsec is rather sparse online. The following
  30. slide deck provides a decent overview.
  31. https://libreswan.org/wiki/images/e/e0/Netdev-0x12-ipsec-flow.pdf
  32. The Linux IPsec stack is part of XFRM, the netlink packet transformation
  33. interface.
  34. https://man7.org/linux/man-pages/man8/ip-xfrm.8.html
  35. */
  36. const (
  37. // Value used to mark outgoing packets which should have our IPsec
  38. // processing applied. It is also used as a label to identify XFRM
  39. // states (Security Associations) and policies (Security Policies)
  40. // programmed by us so we know which ones we can clean up without
  41. // disrupting other VPN connections on the system.
  42. mark = 0xD0C4E3
  43. pktExpansion = 26 // SPI(4) + SeqN(4) + IV(8) + PadLength(1) + NextHeader(1) + ICV(8)
  44. )
  45. const (
  46. forward = iota + 1
  47. reverse
  48. bidir
  49. )
  50. // Mark value for matching packets which should have our IPsec security policy
  51. // applied.
  52. var spMark = netlink.XfrmMark{Value: mark, Mask: 0xffffffff}
  53. type key struct {
  54. value []byte
  55. tag uint32
  56. }
  57. func (k *key) String() string {
  58. if k != nil {
  59. return fmt.Sprintf("(key: %s, tag: 0x%x)", hex.EncodeToString(k.value)[0:5], k.tag)
  60. }
  61. return ""
  62. }
  63. // Security Parameter Indices for the IPsec flows between local node and a
  64. // remote peer, which identify the Security Associations (XFRM states) to be
  65. // applied when encrypting and decrypting packets.
  66. type spi struct {
  67. forward int
  68. reverse int
  69. }
  70. func (s *spi) String() string {
  71. return fmt.Sprintf("SPI(FWD: 0x%x, REV: 0x%x)", uint32(s.forward), uint32(s.reverse))
  72. }
  73. type encrMap struct {
  74. nodes map[string][]*spi
  75. sync.Mutex
  76. }
  77. func (e *encrMap) String() string {
  78. e.Lock()
  79. defer e.Unlock()
  80. b := new(bytes.Buffer)
  81. for k, v := range e.nodes {
  82. b.WriteString("\n")
  83. b.WriteString(k)
  84. b.WriteString(":")
  85. b.WriteString("[")
  86. for _, s := range v {
  87. b.WriteString(s.String())
  88. b.WriteString(",")
  89. }
  90. b.WriteString("]")
  91. }
  92. return b.String()
  93. }
  94. func (d *driver) checkEncryption(nid string, rIP net.IP, isLocal, add bool) error {
  95. logrus.Debugf("checkEncryption(%.7s, %v, %t)", nid, rIP, isLocal)
  96. n := d.network(nid)
  97. if n == nil || !n.secure {
  98. return nil
  99. }
  100. if len(d.keys) == 0 {
  101. return types.ForbiddenErrorf("encryption key is not present")
  102. }
  103. lIP := net.ParseIP(d.bindAddress)
  104. aIP := net.ParseIP(d.advertiseAddress)
  105. nodes := map[string]net.IP{}
  106. switch {
  107. case isLocal:
  108. if err := d.peerDbNetworkWalk(nid, func(pKey *peerKey, pEntry *peerEntry) bool {
  109. if !aIP.Equal(pEntry.vtep) {
  110. nodes[pEntry.vtep.String()] = pEntry.vtep
  111. }
  112. return false
  113. }); err != nil {
  114. logrus.Warnf("Failed to retrieve list of participating nodes in overlay network %.5s: %v", nid, err)
  115. }
  116. default:
  117. if len(d.network(nid).endpoints) > 0 {
  118. nodes[rIP.String()] = rIP
  119. }
  120. }
  121. logrus.Debugf("List of nodes: %s", nodes)
  122. if add {
  123. for _, rIP := range nodes {
  124. if err := setupEncryption(lIP, aIP, rIP, d.secMap, d.keys); err != nil {
  125. logrus.Warnf("Failed to program network encryption between %s and %s: %v", lIP, rIP, err)
  126. }
  127. }
  128. } else {
  129. if len(nodes) == 0 {
  130. if err := removeEncryption(lIP, rIP, d.secMap); err != nil {
  131. logrus.Warnf("Failed to remove network encryption between %s and %s: %v", lIP, rIP, err)
  132. }
  133. }
  134. }
  135. return nil
  136. }
  137. // setupEncryption programs the encryption parameters for secure communication
  138. // between the local node and a remote node.
  139. func setupEncryption(localIP, advIP, remoteIP net.IP, em *encrMap, keys []*key) error {
  140. logrus.Debugf("Programming encryption between %s and %s", localIP, remoteIP)
  141. rIPs := remoteIP.String()
  142. indices := make([]*spi, 0, len(keys))
  143. for i, k := range keys {
  144. spis := &spi{buildSPI(advIP, remoteIP, k.tag), buildSPI(remoteIP, advIP, k.tag)}
  145. dir := reverse
  146. if i == 0 {
  147. dir = bidir
  148. }
  149. fSA, rSA, err := programSA(localIP, remoteIP, spis, k, dir, true)
  150. if err != nil {
  151. logrus.Warn(err)
  152. }
  153. indices = append(indices, spis)
  154. if i != 0 {
  155. continue
  156. }
  157. err = programSP(fSA, rSA, true)
  158. if err != nil {
  159. logrus.Warn(err)
  160. }
  161. }
  162. em.Lock()
  163. em.nodes[rIPs] = indices
  164. em.Unlock()
  165. return nil
  166. }
  167. func removeEncryption(localIP, remoteIP net.IP, em *encrMap) error {
  168. em.Lock()
  169. indices, ok := em.nodes[remoteIP.String()]
  170. em.Unlock()
  171. if !ok {
  172. return nil
  173. }
  174. for i, idxs := range indices {
  175. dir := reverse
  176. if i == 0 {
  177. dir = bidir
  178. }
  179. fSA, rSA, err := programSA(localIP, remoteIP, idxs, nil, dir, false)
  180. if err != nil {
  181. logrus.Warn(err)
  182. }
  183. if i != 0 {
  184. continue
  185. }
  186. err = programSP(fSA, rSA, false)
  187. if err != nil {
  188. logrus.Warn(err)
  189. }
  190. }
  191. return nil
  192. }
  193. func programMangle(vni uint32, add bool) error {
  194. var (
  195. m = strconv.FormatUint(mark, 10)
  196. chain = "OUTPUT"
  197. rule = append(matchVXLAN(overlayutils.VXLANUDPPort(), vni), "-j", "MARK", "--set-mark", m)
  198. a = iptables.Append
  199. action = "install"
  200. )
  201. // TODO IPv6 support
  202. iptable := iptables.GetIptable(iptables.IPv4)
  203. if !add {
  204. a = iptables.Delete
  205. action = "remove"
  206. }
  207. if err := iptable.ProgramRule(iptables.Mangle, chain, a, rule); err != nil {
  208. return fmt.Errorf("could not %s mangle rule: %w", action, err)
  209. }
  210. return nil
  211. }
  212. func programInput(vni uint32, add bool) error {
  213. var (
  214. plainVxlan = matchVXLAN(overlayutils.VXLANUDPPort(), vni)
  215. chain = "INPUT"
  216. msg = "add"
  217. )
  218. rule := func(policy, jump string) []string {
  219. args := append([]string{"-m", "policy", "--dir", "in", "--pol", policy}, plainVxlan...)
  220. return append(args, "-j", jump)
  221. }
  222. // TODO IPv6 support
  223. iptable := iptables.GetIptable(iptables.IPv4)
  224. if !add {
  225. msg = "remove"
  226. }
  227. action := func(a iptables.Action) iptables.Action {
  228. if !add {
  229. return iptables.Delete
  230. }
  231. return a
  232. }
  233. // Drop incoming VXLAN datagrams for the VNI which were received in cleartext.
  234. // Insert at the top of the chain so the packets are dropped even if an
  235. // administrator-configured rule exists which would otherwise unconditionally
  236. // accept incoming VXLAN traffic.
  237. if err := iptable.ProgramRule(iptables.Filter, chain, action(iptables.Insert), rule("none", "DROP")); err != nil {
  238. return fmt.Errorf("could not %s input drop rule: %w", msg, err)
  239. }
  240. return nil
  241. }
  242. func programSA(localIP, remoteIP net.IP, spi *spi, k *key, dir int, add bool) (fSA *netlink.XfrmState, rSA *netlink.XfrmState, err error) {
  243. var (
  244. action = "Removing"
  245. xfrmProgram = ns.NlHandle().XfrmStateDel
  246. )
  247. if add {
  248. action = "Adding"
  249. xfrmProgram = ns.NlHandle().XfrmStateAdd
  250. }
  251. if dir&reverse > 0 {
  252. rSA = &netlink.XfrmState{
  253. Src: remoteIP,
  254. Dst: localIP,
  255. Proto: netlink.XFRM_PROTO_ESP,
  256. Spi: spi.reverse,
  257. Mode: netlink.XFRM_MODE_TRANSPORT,
  258. Reqid: mark,
  259. }
  260. if add {
  261. rSA.Aead = buildAeadAlgo(k, spi.reverse)
  262. }
  263. exists, err := saExists(rSA)
  264. if err != nil {
  265. exists = !add
  266. }
  267. if add != exists {
  268. logrus.Debugf("%s: rSA{%s}", action, rSA)
  269. if err := xfrmProgram(rSA); err != nil {
  270. logrus.Warnf("Failed %s rSA{%s}: %v", action, rSA, err)
  271. }
  272. }
  273. }
  274. if dir&forward > 0 {
  275. fSA = &netlink.XfrmState{
  276. Src: localIP,
  277. Dst: remoteIP,
  278. Proto: netlink.XFRM_PROTO_ESP,
  279. Spi: spi.forward,
  280. Mode: netlink.XFRM_MODE_TRANSPORT,
  281. Reqid: mark,
  282. }
  283. if add {
  284. fSA.Aead = buildAeadAlgo(k, spi.forward)
  285. }
  286. exists, err := saExists(fSA)
  287. if err != nil {
  288. exists = !add
  289. }
  290. if add != exists {
  291. logrus.Debugf("%s fSA{%s}", action, fSA)
  292. if err := xfrmProgram(fSA); err != nil {
  293. logrus.Warnf("Failed %s fSA{%s}: %v.", action, fSA, err)
  294. }
  295. }
  296. }
  297. return
  298. }
  299. func programSP(fSA *netlink.XfrmState, rSA *netlink.XfrmState, add bool) error {
  300. action := "Removing"
  301. xfrmProgram := ns.NlHandle().XfrmPolicyDel
  302. if add {
  303. action = "Adding"
  304. xfrmProgram = ns.NlHandle().XfrmPolicyAdd
  305. }
  306. // Create a congruent cidr
  307. s := types.GetMinimalIP(fSA.Src)
  308. d := types.GetMinimalIP(fSA.Dst)
  309. fullMask := net.CIDRMask(8*len(s), 8*len(s))
  310. fPol := &netlink.XfrmPolicy{
  311. Src: &net.IPNet{IP: s, Mask: fullMask},
  312. Dst: &net.IPNet{IP: d, Mask: fullMask},
  313. Dir: netlink.XFRM_DIR_OUT,
  314. Proto: syscall.IPPROTO_UDP,
  315. DstPort: int(overlayutils.VXLANUDPPort()),
  316. Mark: &spMark,
  317. Tmpls: []netlink.XfrmPolicyTmpl{
  318. {
  319. Src: fSA.Src,
  320. Dst: fSA.Dst,
  321. Proto: netlink.XFRM_PROTO_ESP,
  322. Mode: netlink.XFRM_MODE_TRANSPORT,
  323. Spi: fSA.Spi,
  324. Reqid: mark,
  325. },
  326. },
  327. }
  328. exists, err := spExists(fPol)
  329. if err != nil {
  330. exists = !add
  331. }
  332. if add != exists {
  333. logrus.Debugf("%s fSP{%s}", action, fPol)
  334. if err := xfrmProgram(fPol); err != nil {
  335. logrus.Warnf("%s fSP{%s}: %v", action, fPol, err)
  336. }
  337. }
  338. return nil
  339. }
  340. func saExists(sa *netlink.XfrmState) (bool, error) {
  341. _, err := ns.NlHandle().XfrmStateGet(sa)
  342. switch err {
  343. case nil:
  344. return true, nil
  345. case syscall.ESRCH:
  346. return false, nil
  347. default:
  348. err = fmt.Errorf("Error while checking for SA existence: %v", err)
  349. logrus.Warn(err)
  350. return false, err
  351. }
  352. }
  353. func spExists(sp *netlink.XfrmPolicy) (bool, error) {
  354. _, err := ns.NlHandle().XfrmPolicyGet(sp)
  355. switch err {
  356. case nil:
  357. return true, nil
  358. case syscall.ENOENT:
  359. return false, nil
  360. default:
  361. err = fmt.Errorf("Error while checking for SP existence: %v", err)
  362. logrus.Warn(err)
  363. return false, err
  364. }
  365. }
  366. func buildSPI(src, dst net.IP, st uint32) int {
  367. b := make([]byte, 4)
  368. binary.BigEndian.PutUint32(b, st)
  369. h := fnv.New32a()
  370. h.Write(src)
  371. h.Write(b)
  372. h.Write(dst)
  373. return int(binary.BigEndian.Uint32(h.Sum(nil)))
  374. }
  375. func buildAeadAlgo(k *key, s int) *netlink.XfrmStateAlgo {
  376. salt := make([]byte, 4)
  377. binary.BigEndian.PutUint32(salt, uint32(s))
  378. return &netlink.XfrmStateAlgo{
  379. Name: "rfc4106(gcm(aes))",
  380. Key: append(k.value, salt...),
  381. ICVLen: 64,
  382. }
  383. }
  384. func (d *driver) secMapWalk(f func(string, []*spi) ([]*spi, bool)) error {
  385. d.secMap.Lock()
  386. for node, indices := range d.secMap.nodes {
  387. idxs, stop := f(node, indices)
  388. if idxs != nil {
  389. d.secMap.nodes[node] = idxs
  390. }
  391. if stop {
  392. break
  393. }
  394. }
  395. d.secMap.Unlock()
  396. return nil
  397. }
  398. func (d *driver) setKeys(keys []*key) error {
  399. // Remove any stale policy, state
  400. clearEncryptionStates()
  401. // Accept the encryption keys and clear any stale encryption map
  402. d.Lock()
  403. d.keys = keys
  404. d.secMap = &encrMap{nodes: map[string][]*spi{}}
  405. d.Unlock()
  406. logrus.Debugf("Initial encryption keys: %v", keys)
  407. return nil
  408. }
  409. // updateKeys allows to add a new key and/or change the primary key and/or prune an existing key
  410. // The primary key is the key used in transmission and will go in first position in the list.
  411. func (d *driver) updateKeys(newKey, primary, pruneKey *key) error {
  412. logrus.Debugf("Updating Keys. New: %v, Primary: %v, Pruned: %v", newKey, primary, pruneKey)
  413. logrus.Debugf("Current: %v", d.keys)
  414. var (
  415. newIdx = -1
  416. priIdx = -1
  417. delIdx = -1
  418. lIP = net.ParseIP(d.bindAddress)
  419. aIP = net.ParseIP(d.advertiseAddress)
  420. )
  421. d.Lock()
  422. defer d.Unlock()
  423. // add new
  424. if newKey != nil {
  425. d.keys = append(d.keys, newKey)
  426. newIdx += len(d.keys)
  427. }
  428. for i, k := range d.keys {
  429. if primary != nil && k.tag == primary.tag {
  430. priIdx = i
  431. }
  432. if pruneKey != nil && k.tag == pruneKey.tag {
  433. delIdx = i
  434. }
  435. }
  436. if (newKey != nil && newIdx == -1) ||
  437. (primary != nil && priIdx == -1) ||
  438. (pruneKey != nil && delIdx == -1) {
  439. return types.BadRequestErrorf("cannot find proper key indices while processing key update:"+
  440. "(newIdx,priIdx,delIdx):(%d, %d, %d)", newIdx, priIdx, delIdx)
  441. }
  442. if priIdx != -1 && priIdx == delIdx {
  443. return types.BadRequestErrorf("attempting to both make a key (index %d) primary and delete it", priIdx)
  444. }
  445. d.secMapWalk(func(rIPs string, spis []*spi) ([]*spi, bool) {
  446. rIP := net.ParseIP(rIPs)
  447. return updateNodeKey(lIP, aIP, rIP, spis, d.keys, newIdx, priIdx, delIdx), false
  448. })
  449. // swap primary
  450. if priIdx != -1 {
  451. d.keys[0], d.keys[priIdx] = d.keys[priIdx], d.keys[0]
  452. }
  453. // prune
  454. if delIdx != -1 {
  455. if delIdx == 0 {
  456. delIdx = priIdx
  457. }
  458. d.keys = append(d.keys[:delIdx], d.keys[delIdx+1:]...)
  459. }
  460. logrus.Debugf("Updated: %v", d.keys)
  461. return nil
  462. }
  463. /********************************************************
  464. * Steady state: rSA0, rSA1, rSA2, fSA1, fSP1
  465. * Rotation --> -rSA0, +rSA3, +fSA2, +fSP2/-fSP1, -fSA1
  466. * Steady state: rSA1, rSA2, rSA3, fSA2, fSP2
  467. *********************************************************/
  468. // Spis and keys are sorted in such away the one in position 0 is the primary
  469. func updateNodeKey(lIP, aIP, rIP net.IP, idxs []*spi, curKeys []*key, newIdx, priIdx, delIdx int) []*spi {
  470. logrus.Debugf("Updating keys for node: %s (%d,%d,%d)", rIP, newIdx, priIdx, delIdx)
  471. spis := idxs
  472. logrus.Debugf("Current: %v", spis)
  473. // add new
  474. if newIdx != -1 {
  475. spis = append(spis, &spi{
  476. forward: buildSPI(aIP, rIP, curKeys[newIdx].tag),
  477. reverse: buildSPI(rIP, aIP, curKeys[newIdx].tag),
  478. })
  479. }
  480. if delIdx != -1 {
  481. // -rSA0
  482. programSA(lIP, rIP, spis[delIdx], nil, reverse, false)
  483. }
  484. if newIdx > -1 {
  485. // +rSA2
  486. programSA(lIP, rIP, spis[newIdx], curKeys[newIdx], reverse, true)
  487. }
  488. if priIdx > 0 {
  489. // +fSA2
  490. fSA2, _, _ := programSA(lIP, rIP, spis[priIdx], curKeys[priIdx], forward, true)
  491. // +fSP2, -fSP1
  492. s := types.GetMinimalIP(fSA2.Src)
  493. d := types.GetMinimalIP(fSA2.Dst)
  494. fullMask := net.CIDRMask(8*len(s), 8*len(s))
  495. fSP1 := &netlink.XfrmPolicy{
  496. Src: &net.IPNet{IP: s, Mask: fullMask},
  497. Dst: &net.IPNet{IP: d, Mask: fullMask},
  498. Dir: netlink.XFRM_DIR_OUT,
  499. Proto: syscall.IPPROTO_UDP,
  500. DstPort: int(overlayutils.VXLANUDPPort()),
  501. Mark: &spMark,
  502. Tmpls: []netlink.XfrmPolicyTmpl{
  503. {
  504. Src: fSA2.Src,
  505. Dst: fSA2.Dst,
  506. Proto: netlink.XFRM_PROTO_ESP,
  507. Mode: netlink.XFRM_MODE_TRANSPORT,
  508. Spi: fSA2.Spi,
  509. Reqid: mark,
  510. },
  511. },
  512. }
  513. logrus.Debugf("Updating fSP{%s}", fSP1)
  514. if err := ns.NlHandle().XfrmPolicyUpdate(fSP1); err != nil {
  515. logrus.Warnf("Failed to update fSP{%s}: %v", fSP1, err)
  516. }
  517. // -fSA1
  518. programSA(lIP, rIP, spis[0], nil, forward, false)
  519. }
  520. // swap
  521. if priIdx > 0 {
  522. swp := spis[0]
  523. spis[0] = spis[priIdx]
  524. spis[priIdx] = swp
  525. }
  526. // prune
  527. if delIdx != -1 {
  528. if delIdx == 0 {
  529. delIdx = priIdx
  530. }
  531. spis = append(spis[:delIdx], spis[delIdx+1:]...)
  532. }
  533. logrus.Debugf("Updated: %v", spis)
  534. return spis
  535. }
  536. func (n *network) maxMTU() int {
  537. mtu := 1500
  538. if n.mtu != 0 {
  539. mtu = n.mtu
  540. }
  541. mtu -= vxlanEncap
  542. if n.secure {
  543. // In case of encryption account for the
  544. // esp packet expansion and padding
  545. mtu -= pktExpansion
  546. mtu -= (mtu % 4)
  547. }
  548. return mtu
  549. }
  550. func clearEncryptionStates() {
  551. nlh := ns.NlHandle()
  552. spList, err := nlh.XfrmPolicyList(netlink.FAMILY_ALL)
  553. if err != nil {
  554. logrus.Warnf("Failed to retrieve SP list for cleanup: %v", err)
  555. }
  556. saList, err := nlh.XfrmStateList(netlink.FAMILY_ALL)
  557. if err != nil {
  558. logrus.Warnf("Failed to retrieve SA list for cleanup: %v", err)
  559. }
  560. for _, sp := range spList {
  561. sp := sp
  562. if sp.Mark != nil && sp.Mark.Value == spMark.Value {
  563. if err := nlh.XfrmPolicyDel(&sp); err != nil {
  564. logrus.Warnf("Failed to delete stale SP %s: %v", sp, err)
  565. continue
  566. }
  567. logrus.Debugf("Removed stale SP: %s", sp)
  568. }
  569. }
  570. for _, sa := range saList {
  571. sa := sa
  572. if sa.Reqid == mark {
  573. if err := nlh.XfrmStateDel(&sa); err != nil {
  574. logrus.Warnf("Failed to delete stale SA %s: %v", sa, err)
  575. continue
  576. }
  577. logrus.Debugf("Removed stale SA: %s", sa)
  578. }
  579. }
  580. }