You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

679 lines
17 KiB

  1. /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  2. * All rights reserved.
  3. *
  4. * This package is an SSL implementation written
  5. * by Eric Young (eay@cryptsoft.com).
  6. * The implementation was written so as to conform with Netscapes SSL.
  7. *
  8. * This library is free for commercial and non-commercial use as long as
  9. * the following conditions are aheared to. The following conditions
  10. * apply to all code found in this distribution, be it the RC4, RSA,
  11. * lhash, DES, etc., code; not just the SSL code. The SSL documentation
  12. * included with this distribution is covered by the same copyright terms
  13. * except that the holder is Tim Hudson (tjh@cryptsoft.com).
  14. *
  15. * Copyright remains Eric Young's, and as such any Copyright notices in
  16. * the code are not to be removed.
  17. * If this package is used in a product, Eric Young should be given attribution
  18. * as the author of the parts of the library used.
  19. * This can be in the form of a textual message at program startup or
  20. * in documentation (online or textual) provided with the package.
  21. *
  22. * Redistribution and use in source and binary forms, with or without
  23. * modification, are permitted provided that the following conditions
  24. * are met:
  25. * 1. Redistributions of source code must retain the copyright
  26. * notice, this list of conditions and the following disclaimer.
  27. * 2. Redistributions in binary form must reproduce the above copyright
  28. * notice, this list of conditions and the following disclaimer in the
  29. * documentation and/or other materials provided with the distribution.
  30. * 3. All advertising materials mentioning features or use of this software
  31. * must display the following acknowledgement:
  32. * "This product includes cryptographic software written by
  33. * Eric Young (eay@cryptsoft.com)"
  34. * The word 'cryptographic' can be left out if the rouines from the library
  35. * being used are not cryptographic related :-).
  36. * 4. If you include any Windows specific code (or a derivative thereof) from
  37. * the apps directory (application code) you must include an acknowledgement:
  38. * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
  39. *
  40. * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
  41. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  42. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  43. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  44. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  45. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  46. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  47. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  48. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  49. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  50. * SUCH DAMAGE.
  51. *
  52. * The licence and distribution terms for any publically available version or
  53. * derivative of this code cannot be changed. i.e. this code cannot simply be
  54. * copied and put under another distribution licence
  55. * [including the GNU Public Licence.] */
  56. #include <openssl/obj.h>
  57. #include <limits.h>
  58. #include <string.h>
  59. #include <openssl/asn1.h>
  60. #include <openssl/buf.h>
  61. #include <openssl/bytestring.h>
  62. #include <openssl/err.h>
  63. #include <openssl/lhash.h>
  64. #include <openssl/mem.h>
  65. #include <openssl/thread.h>
  66. #include "obj_dat.h"
  67. #include "../internal.h"
  68. static struct CRYPTO_STATIC_MUTEX global_added_lock = CRYPTO_STATIC_MUTEX_INIT;
  69. /* These globals are protected by |global_added_lock|. */
  70. static LHASH_OF(ASN1_OBJECT) *global_added_by_data = NULL;
  71. static LHASH_OF(ASN1_OBJECT) *global_added_by_nid = NULL;
  72. static LHASH_OF(ASN1_OBJECT) *global_added_by_short_name = NULL;
  73. static LHASH_OF(ASN1_OBJECT) *global_added_by_long_name = NULL;
  74. static struct CRYPTO_STATIC_MUTEX global_next_nid_lock =
  75. CRYPTO_STATIC_MUTEX_INIT;
  76. static unsigned global_next_nid = NUM_NID;
  77. static int obj_next_nid(void) {
  78. int ret;
  79. CRYPTO_STATIC_MUTEX_lock_write(&global_next_nid_lock);
  80. ret = global_next_nid++;
  81. CRYPTO_STATIC_MUTEX_unlock(&global_next_nid_lock);
  82. return ret;
  83. }
  84. ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o) {
  85. ASN1_OBJECT *r;
  86. unsigned char *data = NULL;
  87. char *sn = NULL, *ln = NULL;
  88. if (o == NULL) {
  89. return NULL;
  90. }
  91. if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
  92. /* TODO(fork): this is a little dangerous. */
  93. return (ASN1_OBJECT *)o;
  94. }
  95. r = ASN1_OBJECT_new();
  96. if (r == NULL) {
  97. OPENSSL_PUT_ERROR(OBJ, OBJ_dup, ERR_R_ASN1_LIB);
  98. return NULL;
  99. }
  100. r->ln = r->sn = NULL;
  101. data = OPENSSL_malloc(o->length);
  102. if (data == NULL) {
  103. goto err;
  104. }
  105. if (o->data != NULL) {
  106. memcpy(data, o->data, o->length);
  107. }
  108. /* once data is attached to an object, it remains const */
  109. r->data = data;
  110. r->length = o->length;
  111. r->nid = o->nid;
  112. if (o->ln != NULL) {
  113. ln = OPENSSL_strdup(o->ln);
  114. if (ln == NULL) {
  115. goto err;
  116. }
  117. }
  118. if (o->sn != NULL) {
  119. sn = OPENSSL_strdup(o->sn);
  120. if (sn == NULL) {
  121. goto err;
  122. }
  123. }
  124. r->sn = sn;
  125. r->ln = ln;
  126. r->flags =
  127. o->flags | (ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
  128. ASN1_OBJECT_FLAG_DYNAMIC_DATA);
  129. return r;
  130. err:
  131. OPENSSL_PUT_ERROR(OBJ, OBJ_dup, ERR_R_MALLOC_FAILURE);
  132. if (ln != NULL) {
  133. OPENSSL_free(ln);
  134. }
  135. if (sn != NULL) {
  136. OPENSSL_free(sn);
  137. }
  138. if (data != NULL) {
  139. OPENSSL_free(data);
  140. }
  141. OPENSSL_free(r);
  142. return NULL;
  143. }
  144. int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
  145. int ret;
  146. ret = a->length - b->length;
  147. if (ret) {
  148. return ret;
  149. }
  150. return memcmp(a->data, b->data, a->length);
  151. }
  152. /* nids_cmp is called to search the kNIDsInOIDOrder array. The |key| argument
  153. * is an |ASN1_OBJECT|* that we're looking for and |element| is a pointer to an
  154. * unsigned int in the array. */
  155. static int obj_cmp(const void *key, const void *element) {
  156. int j;
  157. unsigned nid = *((unsigned*) element);
  158. const ASN1_OBJECT *a = key;
  159. const ASN1_OBJECT *b = &kObjects[nid];
  160. j = a->length - b->length;
  161. if (j) {
  162. return j;
  163. }
  164. return memcmp(a->data, b->data, a->length);
  165. }
  166. int OBJ_obj2nid(const ASN1_OBJECT *obj) {
  167. const unsigned int *nid_ptr;
  168. if (obj == NULL) {
  169. return NID_undef;
  170. }
  171. if (obj->nid != 0) {
  172. return obj->nid;
  173. }
  174. CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock);
  175. if (global_added_by_data != NULL) {
  176. ASN1_OBJECT *match;
  177. match = lh_ASN1_OBJECT_retrieve(global_added_by_data, obj);
  178. if (match != NULL) {
  179. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  180. return match->nid;
  181. }
  182. }
  183. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  184. nid_ptr = bsearch(obj, kNIDsInOIDOrder, NUM_OBJ, sizeof(unsigned), obj_cmp);
  185. if (nid_ptr == NULL) {
  186. return NID_undef;
  187. }
  188. return kObjects[*nid_ptr].nid;
  189. }
  190. int OBJ_cbs2nid(const CBS *cbs) {
  191. ASN1_OBJECT obj;
  192. memset(&obj, 0, sizeof(obj));
  193. obj.data = CBS_data(cbs);
  194. obj.length = CBS_len(cbs);
  195. return OBJ_obj2nid(&obj);
  196. }
  197. /* short_name_cmp is called to search the kNIDsInShortNameOrder array. The
  198. * |key| argument is name that we're looking for and |element| is a pointer to
  199. * an unsigned int in the array. */
  200. static int short_name_cmp(const void *key, const void *element) {
  201. const char *name = (const char *) key;
  202. unsigned nid = *((unsigned*) element);
  203. return strcmp(name, kObjects[nid].sn);
  204. }
  205. int OBJ_sn2nid(const char *short_name) {
  206. const unsigned int *nid_ptr;
  207. CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock);
  208. if (global_added_by_short_name != NULL) {
  209. ASN1_OBJECT *match, template;
  210. template.sn = short_name;
  211. match = lh_ASN1_OBJECT_retrieve(global_added_by_short_name, &template);
  212. if (match != NULL) {
  213. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  214. return match->nid;
  215. }
  216. }
  217. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  218. nid_ptr = bsearch(short_name, kNIDsInShortNameOrder, NUM_SN, sizeof(unsigned), short_name_cmp);
  219. if (nid_ptr == NULL) {
  220. return NID_undef;
  221. }
  222. return kObjects[*nid_ptr].nid;
  223. }
  224. /* long_name_cmp is called to search the kNIDsInLongNameOrder array. The
  225. * |key| argument is name that we're looking for and |element| is a pointer to
  226. * an unsigned int in the array. */
  227. static int long_name_cmp(const void *key, const void *element) {
  228. const char *name = (const char *) key;
  229. unsigned nid = *((unsigned*) element);
  230. return strcmp(name, kObjects[nid].ln);
  231. }
  232. int OBJ_ln2nid(const char *long_name) {
  233. const unsigned int *nid_ptr;
  234. CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock);
  235. if (global_added_by_long_name != NULL) {
  236. ASN1_OBJECT *match, template;
  237. template.ln = long_name;
  238. match = lh_ASN1_OBJECT_retrieve(global_added_by_long_name, &template);
  239. if (match != NULL) {
  240. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  241. return match->nid;
  242. }
  243. }
  244. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  245. nid_ptr = bsearch(long_name, kNIDsInLongNameOrder, NUM_LN, sizeof(unsigned), long_name_cmp);
  246. if (nid_ptr == NULL) {
  247. return NID_undef;
  248. }
  249. return kObjects[*nid_ptr].nid;
  250. }
  251. int OBJ_txt2nid(const char *s) {
  252. ASN1_OBJECT *obj;
  253. int nid;
  254. obj = OBJ_txt2obj(s, 0 /* search names */);
  255. nid = OBJ_obj2nid(obj);
  256. ASN1_OBJECT_free(obj);
  257. return nid;
  258. }
  259. OPENSSL_EXPORT int OBJ_nid2cbb(CBB *out, int nid) {
  260. const ASN1_OBJECT *obj = OBJ_nid2obj(nid);
  261. CBB oid;
  262. if (obj == NULL ||
  263. !CBB_add_asn1(out, &oid, CBS_ASN1_OBJECT) ||
  264. !CBB_add_bytes(&oid, obj->data, obj->length) ||
  265. !CBB_flush(out)) {
  266. return 0;
  267. }
  268. return 1;
  269. }
  270. const ASN1_OBJECT *OBJ_nid2obj(int nid) {
  271. if (nid >= 0 && nid < NUM_NID) {
  272. if (nid != NID_undef && kObjects[nid].nid == NID_undef) {
  273. goto err;
  274. }
  275. return &kObjects[nid];
  276. }
  277. CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock);
  278. if (global_added_by_nid != NULL) {
  279. ASN1_OBJECT *match, template;
  280. template.nid = nid;
  281. match = lh_ASN1_OBJECT_retrieve(global_added_by_nid, &template);
  282. if (match != NULL) {
  283. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  284. return match;
  285. }
  286. }
  287. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  288. err:
  289. OPENSSL_PUT_ERROR(OBJ, OBJ_nid2obj, OBJ_R_UNKNOWN_NID);
  290. return NULL;
  291. }
  292. const char *OBJ_nid2sn(int nid) {
  293. const ASN1_OBJECT *obj = OBJ_nid2obj(nid);
  294. if (obj == NULL) {
  295. return NULL;
  296. }
  297. return obj->sn;
  298. }
  299. const char *OBJ_nid2ln(int nid) {
  300. const ASN1_OBJECT *obj = OBJ_nid2obj(nid);
  301. if (obj == NULL) {
  302. return NULL;
  303. }
  304. return obj->ln;
  305. }
  306. ASN1_OBJECT *OBJ_txt2obj(const char *s, int dont_search_names) {
  307. int nid = NID_undef;
  308. ASN1_OBJECT *op = NULL;
  309. unsigned char *buf;
  310. unsigned char *p;
  311. const unsigned char *bufp;
  312. int contents_len, total_len;
  313. if (!dont_search_names) {
  314. nid = OBJ_sn2nid(s);
  315. if (nid == NID_undef) {
  316. nid = OBJ_ln2nid(s);
  317. }
  318. if (nid != NID_undef) {
  319. return (ASN1_OBJECT*) OBJ_nid2obj(nid);
  320. }
  321. }
  322. /* Work out size of content octets */
  323. contents_len = a2d_ASN1_OBJECT(NULL, 0, s, -1);
  324. if (contents_len <= 0) {
  325. return NULL;
  326. }
  327. /* Work out total size */
  328. total_len = ASN1_object_size(0, contents_len, V_ASN1_OBJECT);
  329. buf = OPENSSL_malloc(total_len);
  330. if (buf == NULL) {
  331. OPENSSL_PUT_ERROR(OBJ, OBJ_txt2obj, ERR_R_MALLOC_FAILURE);
  332. return NULL;
  333. }
  334. p = buf;
  335. /* Write out tag+length */
  336. ASN1_put_object(&p, 0, contents_len, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
  337. /* Write out contents */
  338. a2d_ASN1_OBJECT(p, contents_len, s, -1);
  339. bufp = buf;
  340. op = d2i_ASN1_OBJECT(NULL, &bufp, total_len);
  341. OPENSSL_free(buf);
  342. return op;
  343. }
  344. int OBJ_obj2txt(char *out, int out_len, const ASN1_OBJECT *obj, int dont_return_name) {
  345. int i, n = 0, len, nid, first, use_bn;
  346. BIGNUM *bl;
  347. unsigned long l;
  348. const unsigned char *p;
  349. char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  350. if (out && out_len > 0) {
  351. out[0] = 0;
  352. }
  353. if (obj == NULL || obj->data == NULL) {
  354. return 0;
  355. }
  356. if (!dont_return_name && (nid = OBJ_obj2nid(obj)) != NID_undef) {
  357. const char *s;
  358. s = OBJ_nid2ln(nid);
  359. if (s == NULL) {
  360. s = OBJ_nid2sn(nid);
  361. }
  362. if (s) {
  363. if (out) {
  364. BUF_strlcpy(out, s, out_len);
  365. }
  366. return strlen(s);
  367. }
  368. }
  369. len = obj->length;
  370. p = obj->data;
  371. first = 1;
  372. bl = NULL;
  373. while (len > 0) {
  374. l = 0;
  375. use_bn = 0;
  376. for (;;) {
  377. unsigned char c = *p++;
  378. len--;
  379. if (len == 0 && (c & 0x80)) {
  380. goto err;
  381. }
  382. if (use_bn) {
  383. if (!BN_add_word(bl, c & 0x7f)) {
  384. goto err;
  385. }
  386. } else {
  387. l |= c & 0x7f;
  388. }
  389. if (!(c & 0x80)) {
  390. break;
  391. }
  392. if (!use_bn && (l > (ULONG_MAX >> 7L))) {
  393. if (!bl && !(bl = BN_new())) {
  394. goto err;
  395. }
  396. if (!BN_set_word(bl, l)) {
  397. goto err;
  398. }
  399. use_bn = 1;
  400. }
  401. if (use_bn) {
  402. if (!BN_lshift(bl, bl, 7)) {
  403. goto err;
  404. }
  405. } else {
  406. l <<= 7L;
  407. }
  408. }
  409. if (first) {
  410. first = 0;
  411. if (l >= 80) {
  412. i = 2;
  413. if (use_bn) {
  414. if (!BN_sub_word(bl, 80)) {
  415. goto err;
  416. }
  417. } else {
  418. l -= 80;
  419. }
  420. } else {
  421. i = (int)(l / 40);
  422. l -= (long)(i * 40);
  423. }
  424. if (out && out_len > 1) {
  425. *out++ = i + '0';
  426. *out = '0';
  427. out_len--;
  428. }
  429. n++;
  430. }
  431. if (use_bn) {
  432. char *bndec;
  433. bndec = BN_bn2dec(bl);
  434. if (!bndec) {
  435. goto err;
  436. }
  437. i = strlen(bndec);
  438. if (out) {
  439. if (out_len > 1) {
  440. *out++ = '.';
  441. *out = 0;
  442. out_len--;
  443. }
  444. BUF_strlcpy(out, bndec, out_len);
  445. if (i > out_len) {
  446. out += out_len;
  447. out_len = 0;
  448. } else {
  449. out += i;
  450. out_len -= i;
  451. }
  452. }
  453. n++;
  454. n += i;
  455. OPENSSL_free(bndec);
  456. } else {
  457. BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  458. i = strlen(tbuf);
  459. if (out && out_len > 0) {
  460. BUF_strlcpy(out, tbuf, out_len);
  461. if (i > out_len) {
  462. out += out_len;
  463. out_len = 0;
  464. } else {
  465. out += i;
  466. out_len -= i;
  467. }
  468. }
  469. n += i;
  470. }
  471. }
  472. if (bl) {
  473. BN_free(bl);
  474. }
  475. return n;
  476. err:
  477. if (bl) {
  478. BN_free(bl);
  479. }
  480. return -1;
  481. }
  482. static uint32_t hash_nid(const ASN1_OBJECT *obj) {
  483. return obj->nid;
  484. }
  485. static int cmp_nid(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
  486. return a->nid - b->nid;
  487. }
  488. static uint32_t hash_data(const ASN1_OBJECT *obj) {
  489. return OPENSSL_hash32(obj->data, obj->length);
  490. }
  491. static int cmp_data(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
  492. int i = a->length - b->length;
  493. if (i) {
  494. return i;
  495. }
  496. return memcmp(a->data, b->data, a->length);
  497. }
  498. static uint32_t hash_short_name(const ASN1_OBJECT *obj) {
  499. return lh_strhash(obj->sn);
  500. }
  501. static int cmp_short_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
  502. return strcmp(a->sn, b->sn);
  503. }
  504. static uint32_t hash_long_name(const ASN1_OBJECT *obj) {
  505. return lh_strhash(obj->ln);
  506. }
  507. static int cmp_long_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
  508. return strcmp(a->ln, b->ln);
  509. }
  510. /* obj_add_object inserts |obj| into the various global hashes for run-time
  511. * added objects. It returns one on success or zero otherwise. */
  512. static int obj_add_object(ASN1_OBJECT *obj) {
  513. int ok;
  514. ASN1_OBJECT *old_object;
  515. obj->flags &= ~(ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
  516. ASN1_OBJECT_FLAG_DYNAMIC_DATA);
  517. CRYPTO_STATIC_MUTEX_lock_write(&global_added_lock);
  518. if (global_added_by_nid == NULL) {
  519. global_added_by_nid = lh_ASN1_OBJECT_new(hash_nid, cmp_nid);
  520. global_added_by_data = lh_ASN1_OBJECT_new(hash_data, cmp_data);
  521. global_added_by_short_name = lh_ASN1_OBJECT_new(hash_short_name, cmp_short_name);
  522. global_added_by_long_name = lh_ASN1_OBJECT_new(hash_long_name, cmp_long_name);
  523. }
  524. /* We don't pay attention to |old_object| (which contains any previous object
  525. * that was evicted from the hashes) because we don't have a reference count
  526. * on ASN1_OBJECT values. Also, we should never have duplicates nids and so
  527. * should always have objects in |global_added_by_nid|. */
  528. ok = lh_ASN1_OBJECT_insert(global_added_by_nid, &old_object, obj);
  529. if (obj->length != 0 && obj->data != NULL) {
  530. ok &= lh_ASN1_OBJECT_insert(global_added_by_data, &old_object, obj);
  531. }
  532. if (obj->sn != NULL) {
  533. ok &= lh_ASN1_OBJECT_insert(global_added_by_short_name, &old_object, obj);
  534. }
  535. if (obj->ln != NULL) {
  536. ok &= lh_ASN1_OBJECT_insert(global_added_by_long_name, &old_object, obj);
  537. }
  538. CRYPTO_STATIC_MUTEX_unlock(&global_added_lock);
  539. return ok;
  540. }
  541. int OBJ_create(const char *oid, const char *short_name, const char *long_name) {
  542. int ret = NID_undef;
  543. ASN1_OBJECT *op = NULL;
  544. unsigned char *buf = NULL;
  545. int len;
  546. len = a2d_ASN1_OBJECT(NULL, 0, oid, -1);
  547. if (len <= 0) {
  548. goto err;
  549. }
  550. buf = OPENSSL_malloc(len);
  551. if (buf == NULL) {
  552. OPENSSL_PUT_ERROR(OBJ, OBJ_create, ERR_R_MALLOC_FAILURE);
  553. goto err;
  554. }
  555. len = a2d_ASN1_OBJECT(buf, len, oid, -1);
  556. if (len == 0) {
  557. goto err;
  558. }
  559. op = (ASN1_OBJECT *)ASN1_OBJECT_create(obj_next_nid(), buf, len, short_name,
  560. long_name);
  561. if (op == NULL) {
  562. goto err;
  563. }
  564. if (obj_add_object(op)) {
  565. ret = op->nid;
  566. }
  567. op = NULL;
  568. err:
  569. if (op != NULL) {
  570. ASN1_OBJECT_free(op);
  571. }
  572. if (buf != NULL) {
  573. OPENSSL_free(buf);
  574. }
  575. return ret;
  576. }