Lines Matching defs:attr

92 	CK_ATTRIBUTE *attr;
118 for (attr = pk11_attribute_first(dsa);
119 attr != NULL;
120 attr = pk11_attribute_next(dsa, attr))
121 switch (attr->type) {
123 INSIST(keyTemplate[6].type == attr->type);
125 attr->ulValueLen);
128 memmove(keyTemplate[6].pValue, attr->pValue,
129 attr->ulValueLen);
130 keyTemplate[6].ulValueLen = attr->ulValueLen;
133 INSIST(keyTemplate[7].type == attr->type);
135 attr->ulValueLen);
138 memmove(keyTemplate[7].pValue, attr->pValue,
139 attr->ulValueLen);
140 keyTemplate[7].ulValueLen = attr->ulValueLen;
143 INSIST(keyTemplate[8].type == attr->type);
145 attr->ulValueLen);
148 memmove(keyTemplate[8].pValue, attr->pValue,
149 attr->ulValueLen);
150 keyTemplate[8].ulValueLen = attr->ulValueLen;
155 attr->ulValueLen);
158 memmove(keyTemplate[9].pValue, attr->pValue,
159 attr->ulValueLen);
160 keyTemplate[9].ulValueLen = attr->ulValueLen;
226 CK_ATTRIBUTE *attr;
250 for (attr = pk11_attribute_first(dsa);
251 attr != NULL;
252 attr = pk11_attribute_next(dsa, attr))
253 switch (attr->type) {
255 INSIST(keyTemplate[5].type == attr->type);
257 attr->ulValueLen);
260 memmove(keyTemplate[5].pValue, attr->pValue,
261 attr->ulValueLen);
262 keyTemplate[5].ulValueLen = attr->ulValueLen;
265 INSIST(keyTemplate[6].type == attr->type);
267 attr->ulValueLen);
270 memmove(keyTemplate[6].pValue, attr->pValue,
271 attr->ulValueLen);
272 keyTemplate[6].ulValueLen = attr->ulValueLen;
275 INSIST(keyTemplate[7].type == attr->type);
277 attr->ulValueLen);
280 memmove(keyTemplate[7].pValue, attr->pValue,
281 attr->ulValueLen);
282 keyTemplate[7].ulValueLen = attr->ulValueLen;
285 INSIST(keyTemplate[8].type == attr->type);
287 attr->ulValueLen);
290 memmove(keyTemplate[8].pValue, attr->pValue,
291 attr->ulValueLen);
292 keyTemplate[8].ulValueLen = attr->ulValueLen;
540 CK_ATTRIBUTE *attr;
568 dsa->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 5);
571 memset(dsa->repr, 0, sizeof(*attr) * 5);
574 attr = dsa->repr;
575 attr[0].type = CKA_PRIME;
576 attr[1].type = CKA_SUBPRIME;
577 attr[2].type = CKA_BASE;
578 attr[3].type = CKA_VALUE;
579 attr[4].type = CKA_VALUE2;
582 (pk11_ctx->session, dp, attr, 3),
586 attr[i].pValue = isc_mem_get(key->mctx, attr[i].ulValueLen);
587 if (attr[i].pValue == NULL)
589 memset(attr[i].pValue, 0, attr[i].ulValueLen);
592 (pk11_ctx->session, dp, attr, 3),
594 pubTemplate[5].pValue = attr[0].pValue;
595 pubTemplate[5].ulValueLen = attr[0].ulValueLen;
596 pubTemplate[6].pValue = attr[1].pValue;
597 pubTemplate[6].ulValueLen = attr[1].ulValueLen;
598 pubTemplate[7].pValue = attr[2].pValue;
599 pubTemplate[7].ulValueLen = attr[2].ulValueLen;
609 attr = dsa->repr;
610 attr += 3;
612 (pk11_ctx->session, pub, attr, 1),
614 attr->pValue = isc_mem_get(key->mctx, attr->ulValueLen);
615 if (attr->pValue == NULL)
617 memset(attr->pValue, 0, attr->ulValueLen);
619 (pk11_ctx->session, pub, attr, 1),
622 attr++;
623 attr->type = CKA_VALUE;
625 (pk11_ctx->session, priv, attr, 1),
627 attr->pValue = isc_mem_get(key->mctx, attr->ulValueLen);
628 if (attr->pValue == NULL)
630 memset(attr->pValue, 0, attr->ulValueLen);
632 (pk11_ctx->session, priv, attr, 1),
634 attr->type = CKA_VALUE2;
663 CK_ATTRIBUTE *attr;
667 attr = pk11_attribute_bytype(dsa, CKA_VALUE2);
668 return (ISC_TF((attr != NULL) || dsa->ontoken));
674 CK_ATTRIBUTE *attr;
681 for (attr = pk11_attribute_first(dsa);
682 attr != NULL;
683 attr = pk11_attribute_next(dsa, attr))
684 switch (attr->type) {
690 if (attr->pValue != NULL) {
691 isc_safe_memwipe(attr->pValue,
692 attr->ulValueLen);
694 attr->pValue,
695 attr->ulValueLen);
700 isc_safe_memwipe(dsa->repr, dsa->attrcnt * sizeof(*attr));
703 dsa->attrcnt * sizeof(*attr));
714 CK_ATTRIBUTE *attr;
726 for (attr = pk11_attribute_first(dsa);
727 attr != NULL;
728 attr = pk11_attribute_next(dsa, attr))
729 switch (attr->type) {
731 prime = attr;
734 subprime = attr;
737 base = attr;
740 pub_key = attr;
789 CK_ATTRIBUTE *attr;
831 dsa->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 4);
834 memset(dsa->repr, 0, sizeof(*attr) * 4);
837 attr = dsa->repr;
838 attr[0].type = CKA_PRIME;
839 attr[0].pValue = isc_mem_get(key->mctx, p_bytes);
840 if (attr[0].pValue == NULL)
842 memmove(attr[0].pValue, prime, p_bytes);
843 attr[0].ulValueLen = p_bytes;
845 attr[1].type = CKA_SUBPRIME;
846 attr[1].pValue = isc_mem_get(key->mctx, ISC_SHA1_DIGESTLENGTH);
847 if (attr[1].pValue == NULL)
849 memmove(attr[1].pValue, subprime, ISC_SHA1_DIGESTLENGTH);
850 attr[1].ulValueLen = ISC_SHA1_DIGESTLENGTH;
852 attr[2].type = CKA_BASE;
853 attr[2].pValue = isc_mem_get(key->mctx, p_bytes);
854 if (attr[2].pValue == NULL)
856 memmove(attr[2].pValue, base, p_bytes);
857 attr[2].ulValueLen = p_bytes;
859 attr[3].type = CKA_VALUE;
860 attr[3].pValue = isc_mem_get(key->mctx, p_bytes);
861 if (attr[3].pValue == NULL)
863 memmove(attr[3].pValue, pub_key, p_bytes);
864 attr[3].ulValueLen = p_bytes;
871 for (attr = pk11_attribute_first(dsa);
872 attr != NULL;
873 attr = pk11_attribute_next(dsa, attr))
874 switch (attr->type) {
879 if (attr->pValue != NULL) {
880 isc_safe_memwipe(attr->pValue,
881 attr->ulValueLen);
883 attr->pValue,
884 attr->ulValueLen);
889 isc_safe_memwipe(dsa->repr, dsa->attrcnt * sizeof(*attr));
892 dsa->attrcnt * sizeof(*attr));
903 CK_ATTRIBUTE *attr;
919 for (attr = pk11_attribute_first(dsa);
920 attr != NULL;
921 attr = pk11_attribute_next(dsa, attr))
922 switch (attr->type) {
924 prime = attr;
927 subprime = attr;
930 base = attr;
933 pub_key = attr;
936 priv_key = attr;
983 CK_ATTRIBUTE *attr;
1013 dsa->repr = (CK_ATTRIBUTE *) isc_mem_get(key->mctx, sizeof(*attr) * 5);
1016 memset(dsa->repr, 0, sizeof(*attr) * 5);
1018 attr = dsa->repr;
1019 attr[0].type = CKA_PRIME;
1020 attr[1].type = CKA_SUBPRIME;
1021 attr[2].type = CKA_BASE;
1022 attr[3].type = CKA_VALUE;
1023 attr[4].type = CKA_VALUE2;
1035 attr = pk11_attribute_bytype(dsa, CKA_PRIME);
1036 INSIST(attr != NULL);
1037 attr->pValue = bn;
1038 attr->ulValueLen = priv.elements[i].length;
1041 attr = pk11_attribute_bytype(dsa,
1043 INSIST(attr != NULL);
1044 attr->pValue = bn;
1045 attr->ulValueLen = priv.elements[i].length;
1048 attr = pk11_attribute_bytype(dsa, CKA_BASE);
1049 INSIST(attr != NULL);
1050 attr->pValue = bn;
1051 attr->ulValueLen = priv.elements[i].length;
1054 attr = pk11_attribute_bytype(dsa, CKA_VALUE2);
1055 INSIST(attr != NULL);
1056 attr->pValue = bn;
1057 attr->ulValueLen = priv.elements[i].length;
1060 attr = pk11_attribute_bytype(dsa, CKA_VALUE);
1061 INSIST(attr != NULL);
1062 attr->pValue = bn;
1063 attr->ulValueLen = priv.elements[i].length;
1069 attr = pk11_attribute_bytype(dsa, CKA_PRIME);
1070 INSIST(attr != NULL);
1071 key->key_size = pk11_numbits(attr->pValue, attr->ulValueLen);