Lines Matching defs:attr

95 	CK_ATTRIBUTE *attr;
106 attr = pk11_attribute_bytype(priv, CKA_PRIME);
107 if (attr == NULL)
109 keyTemplate[6].pValue = isc_mem_get(key->mctx, attr->ulValueLen);
112 memmove(keyTemplate[6].pValue, attr->pValue, attr->ulValueLen);
113 keyTemplate[6].ulValueLen = attr->ulValueLen;
115 attr = pk11_attribute_bytype(priv, CKA_BASE);
116 if (attr == NULL)
118 keyTemplate[7].pValue = isc_mem_get(key->mctx, attr->ulValueLen);
121 memmove(keyTemplate[7].pValue, attr->pValue, attr->ulValueLen);
122 keyTemplate[7].ulValueLen = attr->ulValueLen;
124 attr = pk11_attribute_bytype(priv, CKA_VALUE2);
125 if (attr == NULL)
127 keyTemplate[8].pValue = isc_mem_get(key->mctx, attr->ulValueLen);
130 memmove(keyTemplate[8].pValue, attr->pValue, attr->ulValueLen);
131 keyTemplate[8].ulValueLen = attr->ulValueLen;
161 CK_ATTRIBUTE *attr;
185 attr = pk11_attribute_bytype(pub->keydata.pkey, CKA_PRIME);
186 if (attr == NULL)
188 REQUIRE(attr != NULL);
189 secLen = attr->ulValueLen;
190 attr = pk11_attribute_bytype(pub->keydata.pkey, CKA_VALUE);
191 if (attr == NULL)
200 mech.ulParameterLen = attr->ulValueLen;
204 memmove(mech.pParameter, attr->pValue, mech.ulParameterLen);
215 attr = valTemplate;
217 (ctx.session, hDerived, attr, (CK_ULONG) 1),
219 attr->pValue = isc_mem_get(pub->mctx, attr->ulValueLen);
220 if (attr->pValue == NULL)
222 memset(attr->pValue, 0, attr->ulValueLen);
224 (ctx.session, hDerived, attr, (CK_ULONG) 1),
228 secValue = (CK_BYTE_PTR) attr->pValue;
229 for (i = 0; i < attr->ulValueLen; i++)
233 if (r.length < attr->ulValueLen - i)
235 memmove(r.base, secValue + i, attr->ulValueLen - i);
236 isc_buffer_add(secret, attr->ulValueLen - i);
400 CK_ATTRIBUTE *attr;
496 dh->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 4);
499 memset(dh->repr, 0, sizeof(*attr) * 4);
502 attr = dh->repr;
503 attr[0].type = CKA_PRIME;
504 attr[0].pValue = pubTemplate[4].pValue;
505 attr[0].ulValueLen = pubTemplate[4].ulValueLen;
508 attr[1].type = CKA_BASE;
509 attr[1].pValue = pubTemplate[5].pValue;
510 attr[1].ulValueLen = pubTemplate[5].ulValueLen;
513 attr += 2;
514 attr->type = CKA_VALUE;
516 (pk11_ctx->session, pub, attr, 1),
518 attr->pValue = isc_mem_get(key->mctx, attr->ulValueLen);
519 if (attr->pValue == NULL)
521 memset(attr->pValue, 0, attr->ulValueLen);
523 (pk11_ctx->session, pub, attr, 1),
526 attr++;
527 attr->type = CKA_VALUE;
529 (pk11_ctx->session, priv, attr, 1),
531 attr->pValue = isc_mem_get(key->mctx, attr->ulValueLen);
532 if (attr->pValue == NULL)
534 memset(attr->pValue, 0, attr->ulValueLen);
536 (pk11_ctx->session, priv, attr, 1),
538 attr->type = CKA_VALUE2;
597 CK_ATTRIBUTE *attr;
601 attr = pk11_attribute_bytype(dh, CKA_VALUE2);
602 return (ISC_TF((attr != NULL) || dh->ontoken));
608 CK_ATTRIBUTE *attr;
615 for (attr = pk11_attribute_first(dh);
616 attr != NULL;
617 attr = pk11_attribute_next(dh, attr))
618 switch (attr->type) {
623 if (attr->pValue != NULL) {
624 isc_safe_memwipe(attr->pValue,
625 attr->ulValueLen);
627 attr->pValue,
628 attr->ulValueLen);
633 isc_safe_memwipe(dh->repr, dh->attrcnt * sizeof(*attr));
634 isc_mem_put(key->mctx, dh->repr, dh->attrcnt * sizeof(*attr));
665 CK_ATTRIBUTE *attr;
674 for (attr = pk11_attribute_first(dh);
675 attr != NULL;
676 attr = pk11_attribute_next(dh, attr))
677 switch (attr->type) {
679 pub = (CK_BYTE *) attr->pValue;
680 publen = (isc_uint16_t) attr->ulValueLen;
683 prime = (CK_BYTE *) attr->pValue;
684 plen = (isc_uint16_t) attr->ulValueLen;
687 base = (CK_BYTE *) attr->pValue;
688 glen = (isc_uint16_t) attr->ulValueLen;
745 CK_ATTRIBUTE *attr;
853 dh->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 3);
856 memset(dh->repr, 0, sizeof(*attr) * 3);
859 attr = dh->repr;
860 attr[0].type = CKA_PRIME;
861 attr[0].pValue = isc_mem_get(key->mctx, plen_);
862 if (attr[0].pValue == NULL)
864 memmove(attr[0].pValue, prime, plen_);
865 attr[0].ulValueLen = (CK_ULONG) plen_;
867 attr[1].type = CKA_BASE;
868 attr[1].pValue = isc_mem_get(key->mctx, glen_);
869 if (attr[1].pValue == NULL)
871 memmove(attr[1].pValue, base, glen_);
872 attr[1].ulValueLen = (CK_ULONG) glen_;
874 attr[2].type = CKA_VALUE;
875 attr[2].pValue = isc_mem_get(key->mctx, publen);
876 if (attr[2].pValue == NULL)
878 memmove(attr[2].pValue, pub, publen);
879 attr[2].ulValueLen = (CK_ULONG) publen;
888 for (attr = pk11_attribute_first(dh);
889 attr != NULL;
890 attr = pk11_attribute_next(dh, attr))
891 switch (attr->type) {
895 if (attr->pValue != NULL) {
896 isc_safe_memwipe(attr->pValue,
897 attr->ulValueLen);
899 attr->pValue,
900 attr->ulValueLen);
905 isc_safe_memwipe(dh->repr, dh->attrcnt * sizeof(*attr));
906 isc_mem_put(key->mctx, dh->repr, dh->attrcnt * sizeof(*attr));
923 CK_ATTRIBUTE *attr;
937 for (attr = pk11_attribute_first(dh);
938 attr != NULL;
939 attr = pk11_attribute_next(dh, attr))
940 switch (attr->type) {
942 pub = attr;
945 prv = attr;
948 prime = attr;
951 base = attr;
1012 CK_ATTRIBUTE *attr;
1031 dh->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 4);
1034 memset(dh->repr, 0, sizeof(*attr) * 4);
1036 attr = dh->repr;
1037 attr[0].type = CKA_PRIME;
1038 attr[1].type = CKA_BASE;
1039 attr[2].type = CKA_VALUE;
1040 attr[3].type = CKA_VALUE2;
1052 attr = pk11_attribute_bytype(dh, CKA_PRIME);
1053 INSIST(attr != NULL);
1054 attr->pValue = bn;
1055 attr->ulValueLen = priv.elements[i].length;
1058 attr = pk11_attribute_bytype(dh, CKA_BASE);
1059 INSIST(attr != NULL);
1060 attr->pValue = bn;
1061 attr->ulValueLen = priv.elements[i].length;
1064 attr = pk11_attribute_bytype(dh, CKA_VALUE2);
1065 INSIST(attr != NULL);
1066 attr->pValue = bn;
1067 attr->ulValueLen = priv.elements[i].length;
1070 attr = pk11_attribute_bytype(dh, CKA_VALUE);
1071 INSIST(attr != NULL);
1072 attr->pValue = bn;
1073 attr->ulValueLen = priv.elements[i].length;
1079 attr = pk11_attribute_bytype(dh, CKA_PRIME);
1080 INSIST(attr != NULL);
1081 key->key_size = pk11_numbits(attr->pValue, attr->ulValueLen);