Lines Matching defs:attr

139 	CK_ATTRIBUTE *attr;
183 for (attr = pk11_attribute_first(ec);
184 attr != NULL;
185 attr = pk11_attribute_next(ec, attr))
186 switch (attr->type) {
188 INSIST(keyTemplate[5].type == attr->type);
190 attr->ulValueLen);
193 memmove(keyTemplate[5].pValue, attr->pValue,
194 attr->ulValueLen);
195 keyTemplate[5].ulValueLen = attr->ulValueLen;
198 INSIST(keyTemplate[6].type == attr->type);
200 attr->ulValueLen);
203 memmove(keyTemplate[6].pValue, attr->pValue,
204 attr->ulValueLen);
205 keyTemplate[6].ulValueLen = attr->ulValueLen;
272 CK_ATTRIBUTE *attr;
299 for (attr = pk11_attribute_first(ec);
300 attr != NULL;
301 attr = pk11_attribute_next(ec, attr))
302 switch (attr->type) {
304 INSIST(keyTemplate[5].type == attr->type);
306 attr->ulValueLen);
309 memmove(keyTemplate[5].pValue, attr->pValue,
310 attr->ulValueLen);
311 keyTemplate[5].ulValueLen = attr->ulValueLen;
316 attr->ulValueLen);
319 memmove(keyTemplate[6].pValue, attr->pValue,
320 attr->ulValueLen);
321 keyTemplate[6].ulValueLen = attr->ulValueLen;
418 attr->pValue = isc_mem_get(key->mctx, \
420 if (attr->pValue == NULL) \
422 memmove(attr->pValue, \
424 attr->ulValueLen = sizeof(pk11_ecc_ed25519); \
426 attr->pValue = isc_mem_get(key->mctx, \
428 if (attr->pValue == NULL) \
430 memmove(attr->pValue, \
432 attr->ulValueLen = sizeof(pk11_ecc_ed448); \
436 if (attr->pValue != NULL) { \
437 memset(attr->pValue, 0, attr->ulValueLen); \
438 isc_mem_put(key->mctx, attr->pValue, attr->ulValueLen); \
439 attr->pValue = NULL; \
470 CK_ATTRIBUTE *attr;
494 ec->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 3);
497 memset(ec->repr, 0, sizeof(*attr) * 3);
500 attr = ec->repr;
501 attr[0].type = CKA_EC_PARAMS;
502 attr[1].type = CKA_VALUE;
503 attr[2].type = CKA_VALUE;
505 attr = &pubTemplate[5];
515 attr = &pubTemplate[5];
518 attr = ec->repr;
521 attr++;
523 (pk11_ctx->session, pub, attr, 1),
525 attr->pValue = isc_mem_get(key->mctx, attr->ulValueLen);
526 if (attr->pValue == NULL)
528 memset(attr->pValue, 0, attr->ulValueLen);
530 (pk11_ctx->session, pub, attr, 1),
532 attr->type = CKA_EC_POINT;
534 attr++;
536 (pk11_ctx->session, priv, attr, 1),
538 attr->pValue = isc_mem_get(key->mctx, attr->ulValueLen);
539 if (attr->pValue == NULL)
541 memset(attr->pValue, 0, attr->ulValueLen);
543 (pk11_ctx->session, priv, attr, 1),
575 CK_ATTRIBUTE *attr;
579 attr = pk11_attribute_bytype(ec, CKA_VALUE);
580 return (ISC_TF((attr != NULL) || ec->ontoken));
586 CK_ATTRIBUTE *attr;
593 for (attr = pk11_attribute_first(ec);
594 attr != NULL;
595 attr = pk11_attribute_next(ec, attr))
596 switch (attr->type) {
606 memset(ec->repr, 0, ec->attrcnt * sizeof(*attr));
609 ec->attrcnt * sizeof(*attr));
621 CK_ATTRIBUTE *attr;
631 attr = pk11_attribute_bytype(ec, CKA_EC_POINT);
632 if ((attr == NULL) || (attr->ulValueLen != len))
638 memmove(r.base, (CK_BYTE_PTR) attr->pValue, len);
649 CK_ATTRIBUTE *attr;
669 ec->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 2);
674 attr = ec->repr;
675 attr->type = CKA_EC_PARAMS;
677 attr->pValue =
679 if (attr->pValue == NULL)
681 memmove(attr->pValue,
683 attr->ulValueLen = sizeof(pk11_ecc_ed25519);
685 attr->pValue =
687 if (attr->pValue == NULL)
689 memmove(attr->pValue,
691 attr->ulValueLen = sizeof(pk11_ecc_ed448);
694 attr++;
695 attr->type = CKA_EC_POINT;
696 attr->pValue = isc_mem_get(key->mctx, len);
697 if (attr->pValue == NULL)
699 memmove((CK_BYTE_PTR) attr->pValue, r.base, len);
700 attr->ulValueLen = len;
708 for (attr = pk11_attribute_first(ec);
709 attr != NULL;
710 attr = pk11_attribute_next(ec, attr))
711 switch (attr->type) {
718 memset(ec->repr, 0, ec->attrcnt * sizeof(*attr));
721 ec->attrcnt * sizeof(*attr));
735 CK_ATTRIBUTE *attr;
746 attr = pk11_attribute_bytype(ec, CKA_VALUE);
747 if (attr != NULL) {
748 buf = isc_mem_get(key->mctx, attr->ulValueLen);
752 priv.elements[i].length = (unsigned short) attr->ulValueLen;
753 memmove(buf, attr->pValue, attr->ulValueLen);
776 memset(buf, 0, attr->ulValueLen);
777 isc_mem_put(key->mctx, buf, attr->ulValueLen);
797 CK_ATTRIBUTE *attr;
813 ec->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 2);
816 memset(ec->repr, 0, sizeof(*attr) * 2);
818 attr = ec->repr;
820 attr->type = CKA_EC_PARAMS;
822 attr->pValue = isc_mem_get(key->mctx, pubattr->ulValueLen);
823 if (attr->pValue == NULL)
825 memmove(attr->pValue, pubattr->pValue, pubattr->ulValueLen);
826 attr->ulValueLen = pubattr->ulValueLen;
827 attr++;
829 attr->type = CKA_EC_POINT;
831 attr->pValue = isc_mem_get(key->mctx, pubattr->ulValueLen);
832 if (attr->pValue == NULL)
834 memmove(attr->pValue, pubattr->pValue, pubattr->ulValueLen);
835 attr->ulValueLen = pubattr->ulValueLen;
850 attr = pk11_attribute_bytype(ec, CKA_LABEL);
851 if (attr == NULL) {
852 attr = pk11_attribute_bytype(ec, CKA_ID);
853 INSIST(attr != NULL);
856 searchTemplate[3].pValue = attr->pValue;
857 searchTemplate[3].ulValueLen = attr->ulValueLen;
900 CK_ATTRIBUTE *attr, *pattr;
958 ec->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 3);
961 memset(ec->repr, 0, sizeof(*attr) * 3);
964 attr = ec->repr;
965 attr->type = CKA_EC_PARAMS;
968 attr->pValue = isc_mem_get(key->mctx, pattr->ulValueLen);
969 if (attr->pValue == NULL)
971 memmove(attr->pValue, pattr->pValue, pattr->ulValueLen);
972 attr->ulValueLen = pattr->ulValueLen;
974 attr++;
975 attr->type = CKA_EC_POINT;
978 attr->pValue = isc_mem_get(key->mctx, pattr->ulValueLen);
979 if (attr->pValue == NULL)
981 memmove(attr->pValue, pattr->pValue, pattr->ulValueLen);
982 attr->ulValueLen = pattr->ulValueLen;
984 attr++;
985 attr->type = CKA_VALUE;
986 attr->pValue = isc_mem_get(key->mctx, priv.elements[0].length);
987 if (attr->pValue == NULL)
989 memmove(attr->pValue, priv.elements[0].data, priv.elements[0].length);
990 attr->ulValueLen = priv.elements[0].length;
1024 CK_ATTRIBUTE *attr;
1041 ec->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 2);
1044 memset(ec->repr, 0, sizeof(*attr) * 2);
1046 attr = ec->repr;
1047 attr[0].type = CKA_EC_PARAMS;
1048 attr[1].type = CKA_VALUE;
1063 attr = pk11_attribute_bytype(ec, CKA_LABEL);
1064 if (attr == NULL) {
1065 attr = pk11_attribute_bytype(ec, CKA_ID);
1066 INSIST(attr != NULL);
1069 searchTemplate[3].pValue = attr->pValue;
1070 searchTemplate[3].ulValueLen = attr->ulValueLen;
1084 attr = ec->repr;
1086 (pk11_ctx->session, hKey, attr, 2),
1089 attr[i].pValue = isc_mem_get(key->mctx, attr[i].ulValueLen);
1090 if (attr[i].pValue == NULL)
1092 memset(attr[i].pValue, 0, attr[i].ulValueLen);
1095 (pk11_ctx->session, hKey, attr, 2),
1097 attr[1].type = CKA_EC_POINT;