4 * This is free software; see Copyright file in the source
5 * distribution for preciese wording.
7 * Copyrigth (C) 2003 Cordys R&D BV, All rights reserved.
8 * Copyright (C) 2003 Aleksey Sanin <aleksey@aleksey.com>
9 * Copyright (c) 2005-2006 Cryptocom LTD (http://www.cryptocom.ru).
17 #ifndef XMLSEC_NO_GOST
21 #include <xmlsec/xmlsec.h>
22 #include <xmlsec/keys.h>
23 #include <xmlsec/transforms.h>
24 #include <xmlsec/errors.h>
26 #include <xmlsec/mscrypto/crypto.h>
27 #include <xmlsec/mscrypto/symbols.h>
28 #include <xmlsec/mscrypto/certkeys.h>
29 #include <xmlsec/mscrypto/x509.h>
31 /*FIXME: include header files*/
32 extern HCRYPTPROV xmlSecMSCryptoKeyDataGetMSCryptoProvider(xmlSecKeyDataPtr data);
33 extern DWORD xmlSecMSCryptoKeyDataGetMSCryptoKeySpec(xmlSecKeyDataPtr data);
35 #if defined(__MINGW32__)
36 # include "xmlsec-mingw.h"
39 /**************************************************************************
41 * Internal MSCrypto signatures ctx
43 *****************************************************************************/
44 typedef struct _xmlSecMSCryptoSignatureCtx xmlSecMSCryptoSignatureCtx,
45 *xmlSecMSCryptoSignatureCtxPtr;
46 struct _xmlSecMSCryptoSignatureCtx {
47 xmlSecKeyDataPtr data;
51 xmlSecKeyDataId keyId;
54 /******************************************************************************
56 * Signature transforms
58 * xmlSecMSCryptoSignatureCtx is located after xmlSecTransform
60 *****************************************************************************/
61 #define xmlSecMSCryptoSignatureSize \
62 (sizeof(xmlSecTransform) + sizeof(xmlSecMSCryptoSignatureCtx))
63 #define xmlSecMSCryptoSignatureGetCtx(transform) \
64 ((xmlSecMSCryptoSignatureCtxPtr)(((xmlSecByte*)(transform)) + sizeof(xmlSecTransform)))
66 static int xmlSecMSCryptoSignatureCheckId (xmlSecTransformPtr transform);
67 static int xmlSecMSCryptoSignatureInitialize (xmlSecTransformPtr transform);
68 static void xmlSecMSCryptoSignatureFinalize (xmlSecTransformPtr transform);
69 static int xmlSecMSCryptoSignatureSetKeyReq (xmlSecTransformPtr transform,
70 xmlSecKeyReqPtr keyReq);
71 static int xmlSecMSCryptoSignatureSetKey (xmlSecTransformPtr transform,
73 static int xmlSecMSCryptoSignatureVerify (xmlSecTransformPtr transform,
74 const xmlSecByte* data,
76 xmlSecTransformCtxPtr transformCtx);
77 static int xmlSecMSCryptoSignatureExecute (xmlSecTransformPtr transform,
79 xmlSecTransformCtxPtr transformCtx);
82 static int xmlSecMSCryptoSignatureCheckId(xmlSecTransformPtr transform) {
85 if(xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformDsaSha1Id)) {
88 #endif /* XMLSEC_NO_DSA */
90 #ifndef XMLSEC_NO_GOST
91 if(xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformGost2001GostR3411_94Id)) {
94 #endif /* XMLSEC_NO_GOST*/
97 if(xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformRsaSha1Id)) {
100 #endif /* XMLSEC_NO_RSA */
105 static int xmlSecMSCryptoSignatureInitialize(xmlSecTransformPtr transform) {
106 xmlSecMSCryptoSignatureCtxPtr ctx;
108 xmlSecAssert2(xmlSecMSCryptoSignatureCheckId(transform), -1);
109 xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecMSCryptoSignatureSize), -1);
111 ctx = xmlSecMSCryptoSignatureGetCtx(transform);
112 xmlSecAssert2(ctx != NULL, -1);
114 memset(ctx, 0, sizeof(xmlSecMSCryptoSignatureCtx));
116 #ifndef XMLSEC_NO_RSA
117 if(xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformRsaSha1Id)) {
118 ctx->digestAlgId = CALG_SHA1;
119 ctx->keyId = xmlSecMSCryptoKeyDataRsaId;
121 #endif /* XMLSEC_NO_RSA */
123 #ifndef XMLSEC_NO_GOST
124 if(xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformGost2001GostR3411_94Id)) {
125 ctx->digestAlgId = CALG_MAGPRO_HASH_R3411_94;
126 ctx->keyId = xmlSecMSCryptoKeyDataGost2001Id;
128 #endif /* XMLSEC_NO_GOST*/
130 #ifndef XMLSEC_NO_DSA
131 if(xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformDsaSha1Id)) {
132 ctx->digestAlgId = CALG_SHA1;
133 ctx->keyId = xmlSecMSCryptoKeyDataDsaId;
135 #endif /* XMLSEC_NO_DSA */
138 xmlSecError(XMLSEC_ERRORS_HERE,
139 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
141 XMLSEC_ERRORS_R_INVALID_TRANSFORM,
142 XMLSEC_ERRORS_NO_MESSAGE);
149 static void xmlSecMSCryptoSignatureFinalize(xmlSecTransformPtr transform) {
150 xmlSecMSCryptoSignatureCtxPtr ctx;
152 xmlSecAssert(xmlSecMSCryptoSignatureCheckId(transform));
153 xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecMSCryptoSignatureSize));
155 ctx = xmlSecMSCryptoSignatureGetCtx(transform);
156 xmlSecAssert(ctx != NULL);
159 CryptDestroyHash(ctx->mscHash);
162 if (ctx->data != NULL) {
163 xmlSecKeyDataDestroy(ctx->data);
167 memset(ctx, 0, sizeof(xmlSecMSCryptoSignatureCtx));
170 static int xmlSecMSCryptoSignatureSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) {
171 xmlSecMSCryptoSignatureCtxPtr ctx;
172 xmlSecKeyDataPtr value;
174 xmlSecAssert2(xmlSecMSCryptoSignatureCheckId(transform), -1);
175 xmlSecAssert2((transform->operation == xmlSecTransformOperationSign) || (transform->operation == xmlSecTransformOperationVerify), -1);
176 xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecMSCryptoSignatureSize), -1);
177 xmlSecAssert2(key != NULL, -1);
179 ctx = xmlSecMSCryptoSignatureGetCtx(transform);
180 xmlSecAssert2(ctx != NULL, -1);
181 xmlSecAssert2(ctx->digestAlgId != 0, -1);
182 xmlSecAssert2(ctx->keyId != NULL, -1);
183 xmlSecAssert2(xmlSecKeyCheckId(key, ctx->keyId), -1);
185 value = xmlSecKeyGetValue(key);
186 xmlSecAssert2(value != NULL, -1);
188 ctx->data = xmlSecKeyDataDuplicate(value);
189 if(ctx->data == NULL) {
190 xmlSecError(XMLSEC_ERRORS_HERE,
191 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
192 "xmlSecKeyDataDuplicate",
193 XMLSEC_ERRORS_R_XMLSEC_FAILED,
194 XMLSEC_ERRORS_NO_MESSAGE);
201 static int xmlSecMSCryptoSignatureSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) {
202 xmlSecMSCryptoSignatureCtxPtr ctx;
204 xmlSecAssert2(xmlSecMSCryptoSignatureCheckId(transform), -1);
205 xmlSecAssert2((transform->operation == xmlSecTransformOperationSign) || (transform->operation == xmlSecTransformOperationVerify), -1);
206 xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecMSCryptoSignatureSize), -1);
207 xmlSecAssert2(keyReq != NULL, -1);
209 ctx = xmlSecMSCryptoSignatureGetCtx(transform);
210 xmlSecAssert2(ctx != NULL, -1);
211 xmlSecAssert2(ctx->keyId != NULL, -1);
213 keyReq->keyId = ctx->keyId;
214 if(transform->operation == xmlSecTransformOperationSign) {
215 keyReq->keyType = xmlSecKeyDataTypePrivate;
216 keyReq->keyUsage = xmlSecKeyUsageSign;
218 keyReq->keyType = xmlSecKeyDataTypePublic;
219 keyReq->keyUsage = xmlSecKeyUsageVerify;
225 static int xmlSecMSCryptoSignatureVerify(xmlSecTransformPtr transform,
226 const xmlSecByte* data,
228 xmlSecTransformCtxPtr transformCtx) {
229 xmlSecMSCryptoSignatureCtxPtr ctx;
233 BYTE *tmpBuf, *j, *k, *l, *m;
236 xmlSecAssert2(xmlSecMSCryptoSignatureCheckId(transform), -1);
237 xmlSecAssert2(transform->operation == xmlSecTransformOperationVerify, -1);
238 xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecMSCryptoSignatureSize), -1);
239 xmlSecAssert2(transform->status == xmlSecTransformStatusFinished, -1);
240 xmlSecAssert2(data != NULL, -1);
241 xmlSecAssert2(dataSize > 0, -1);
242 xmlSecAssert2(transformCtx != NULL, -1);
244 ctx = xmlSecMSCryptoSignatureGetCtx(transform);
245 xmlSecAssert2(ctx != NULL, -1);
247 ret = xmlSecBufferInitialize(&tmp, dataSize);
249 xmlSecError(XMLSEC_ERRORS_HERE,
250 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
251 "xmlSecBufferInitialize",
252 XMLSEC_ERRORS_R_XMLSEC_FAILED,
253 "dataSize=%d", dataSize);
257 tmpBuf = xmlSecBufferGetData(&tmp);
258 xmlSecAssert2(tmpBuf != NULL, -1);
260 /* Reverse the sig - Windows stores integers as octet streams in little endian
261 * order. The I2OSP algorithm used by XMLDSig to store integers is big endian */
262 if (xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformDsaSha1Id)) {
264 k = (BYTE *)data + 20;
267 while (l >= tmpBuf) {
271 #ifndef XMLSEC_NO_GOST
272 } else if (xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformGost2001GostR3411_94Id)) {
274 l = tmpBuf + dataSize - 1;
275 while (l >= tmpBuf) {
278 #endif /*ndef XMLSEC_NO_GOST*/
279 } else if (xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformRsaSha1Id)) {
281 l = tmpBuf + dataSize - 1;
282 while (l >= tmpBuf) {
286 xmlSecError(XMLSEC_ERRORS_HERE,
287 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
289 XMLSEC_ERRORS_R_XMLSEC_FAILED,
291 xmlSecBufferFinalize(&tmp);
295 hKey = xmlSecMSCryptoKeyDataGetKey(ctx->data, xmlSecKeyDataTypePublic);
297 xmlSecError(XMLSEC_ERRORS_HERE,
298 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
299 "xmlSecMSCryptoKeyDataGetKey",
300 XMLSEC_ERRORS_R_XMLSEC_FAILED,
301 XMLSEC_ERRORS_NO_MESSAGE);
302 xmlSecBufferFinalize(&tmp);
305 if (!CryptVerifySignature(ctx->mscHash,
311 dwError = GetLastError();
312 if (NTE_BAD_SIGNATURE == dwError) {
313 xmlSecError(XMLSEC_ERRORS_HERE,
314 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
315 "CryptVerifySignature",
316 XMLSEC_ERRORS_R_DATA_NOT_MATCH,
317 "signature do not match");
318 transform->status = xmlSecTransformStatusFail;
319 xmlSecBufferFinalize(&tmp);
322 xmlSecError(XMLSEC_ERRORS_HERE,
323 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
324 "CryptVerifySignature",
325 XMLSEC_ERRORS_R_CRYPTO_FAILED,
326 XMLSEC_ERRORS_NO_MESSAGE);
327 xmlSecBufferFinalize(&tmp);
331 xmlSecBufferFinalize(&tmp);
332 transform->status = xmlSecTransformStatusOk;
337 xmlSecMSCryptoSignatureExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) {
338 xmlSecMSCryptoSignatureCtxPtr ctx;
341 xmlSecBufferPtr in, out;
342 xmlSecSize inSize, outSize;
345 BYTE *tmpBuf, *outBuf, *i, *j, *m, *n;
347 xmlSecAssert2(xmlSecMSCryptoSignatureCheckId(transform), -1);
348 xmlSecAssert2((transform->operation == xmlSecTransformOperationSign) || (transform->operation == xmlSecTransformOperationVerify), -1);
349 xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecMSCryptoSignatureSize), -1);
350 xmlSecAssert2(transformCtx != NULL, -1);
352 ctx = xmlSecMSCryptoSignatureGetCtx(transform);
353 xmlSecAssert2(ctx != NULL, -1);
355 in = &(transform->inBuf);
356 out = &(transform->outBuf);
357 inSize = xmlSecBufferGetSize(in);
358 outSize = xmlSecBufferGetSize(out);
360 ctx = xmlSecMSCryptoSignatureGetCtx(transform);
361 xmlSecAssert2(ctx != NULL, -1);
362 xmlSecAssert2(ctx->digestAlgId != 0, -1);
364 if(transform->status == xmlSecTransformStatusNone) {
365 xmlSecAssert2(outSize == 0, -1);
367 if (0 == (hProv = xmlSecMSCryptoKeyDataGetMSCryptoProvider(ctx->data))) {
368 xmlSecError(XMLSEC_ERRORS_HERE,
369 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
370 "xmlSecMSCryptoKeyDataGetMSCryptoProvider",
371 XMLSEC_ERRORS_R_CRYPTO_FAILED,
372 XMLSEC_ERRORS_NO_MESSAGE);
375 if (!CryptCreateHash(hProv, ctx->digestAlgId, 0, 0, &(ctx->mscHash))) {
376 xmlSecError(XMLSEC_ERRORS_HERE,
379 XMLSEC_ERRORS_R_CRYPTO_FAILED,
380 XMLSEC_ERRORS_NO_MESSAGE);
384 transform->status = xmlSecTransformStatusWorking;
387 if((transform->status == xmlSecTransformStatusWorking) && (inSize > 0)) {
388 xmlSecAssert2(outSize == 0, -1);
390 if (!CryptHashData(ctx->mscHash, xmlSecBufferGetData(in), inSize, 0)) {
391 xmlSecError(XMLSEC_ERRORS_HERE,
394 XMLSEC_ERRORS_R_CRYPTO_FAILED,
395 XMLSEC_ERRORS_NO_MESSAGE);
399 ret = xmlSecBufferRemoveHead(in, inSize);
401 xmlSecError(XMLSEC_ERRORS_HERE,
402 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
403 "xmlSecBufferRemoveHead",
404 XMLSEC_ERRORS_R_XMLSEC_FAILED,
405 XMLSEC_ERRORS_NO_MESSAGE);
410 if((transform->status == xmlSecTransformStatusWorking) && (last != 0)) {
413 xmlSecAssert2(outSize == 0, -1);
415 if(transform->operation == xmlSecTransformOperationSign) {
416 dwKeySpec = xmlSecMSCryptoKeyDataGetMSCryptoKeySpec(ctx->data);
417 if (!CryptSignHash(ctx->mscHash, dwKeySpec, NULL, 0, NULL, &dwSigLen)) {
418 xmlSecError(XMLSEC_ERRORS_HERE,
421 XMLSEC_ERRORS_R_CRYPTO_FAILED,
422 XMLSEC_ERRORS_NO_MESSAGE);
425 outSize = (xmlSecSize)dwSigLen;
427 ret = xmlSecBufferInitialize(&tmp, outSize);
429 xmlSecError(XMLSEC_ERRORS_HERE,
430 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
431 "xmlSecBufferSetMaxSize",
432 XMLSEC_ERRORS_R_XMLSEC_FAILED,
436 tmpBuf = xmlSecBufferGetData(&tmp);
437 xmlSecAssert2(tmpBuf != NULL, -1);
439 if (!CryptSignHash(ctx->mscHash, dwKeySpec, NULL, 0, tmpBuf, &dwSigLen)) {
440 xmlSecError(XMLSEC_ERRORS_HERE,
443 XMLSEC_ERRORS_R_CRYPTO_FAILED,
444 XMLSEC_ERRORS_NO_MESSAGE);
445 xmlSecBufferFinalize(&tmp);
448 outSize = (xmlSecSize)dwSigLen;
450 ret = xmlSecBufferSetSize(out, outSize);
452 xmlSecError(XMLSEC_ERRORS_HERE,
453 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
454 "xmlSecBufferSetSize",
455 XMLSEC_ERRORS_R_XMLSEC_FAILED,
457 xmlSecBufferFinalize(&tmp);
460 outBuf = xmlSecBufferGetData(out);
461 xmlSecAssert2(outBuf != NULL, -1);
463 /* Now encode into a signature block,
464 * convert signature value to big endian */
465 if (xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformDsaSha1Id)) {
470 while (m >= outBuf) {
474 #ifndef XMLSEC_NO_GOST
475 } else if (xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformGost2001GostR3411_94Id)) {
477 j = outBuf + dwSigLen - 1;
479 while (j >= outBuf) {
482 #endif /*ndef XMLSEC_NO_GOST*/
483 } else if (xmlSecTransformCheckId(transform, xmlSecMSCryptoTransformRsaSha1Id)) {
485 j = outBuf + dwSigLen - 1;
487 while (j >= outBuf) {
491 /* We shouldn't get at this place */
492 xmlSecError(XMLSEC_ERRORS_HERE,
493 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
495 XMLSEC_ERRORS_R_XMLSEC_FAILED,
497 xmlSecBufferFinalize(&tmp);
500 xmlSecBufferFinalize(&tmp);
502 transform->status = xmlSecTransformStatusFinished;
505 if((transform->status == xmlSecTransformStatusWorking) || (transform->status == xmlSecTransformStatusFinished)) {
506 /* the only way we can get here is if there is no input */
507 xmlSecAssert2(xmlSecBufferGetSize(&(transform->inBuf)) == 0, -1);
509 xmlSecError(XMLSEC_ERRORS_HERE,
510 xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
512 XMLSEC_ERRORS_R_INVALID_STATUS,
513 "status=%d", transform->status);
521 #ifndef XMLSEC_NO_RSA
522 /****************************************************************************
524 * RSA-SHA1 signature transform
526 ***************************************************************************/
527 static xmlSecTransformKlass xmlSecMSCryptoRsaSha1Klass = {
528 /* klass/object sizes */
529 sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */
530 xmlSecMSCryptoSignatureSize, /* xmlSecSize objSize */
532 xmlSecNameRsaSha1, /* const xmlChar* name; */
533 xmlSecHrefRsaSha1, /* const xmlChar* href; */
534 xmlSecTransformUsageSignatureMethod, /* xmlSecTransformUsage usage; */
536 xmlSecMSCryptoSignatureInitialize, /* xmlSecTransformInitializeMethod initialize; */
537 xmlSecMSCryptoSignatureFinalize, /* xmlSecTransformFinalizeMethod finalize; */
538 NULL, /* xmlSecTransformNodeReadMethod readNode; */
539 NULL, /* xmlSecTransformNodeWriteMethod writeNode; */
540 xmlSecMSCryptoSignatureSetKeyReq, /* xmlSecTransformSetKeyReqMethod setKeyReq; */
541 xmlSecMSCryptoSignatureSetKey, /* xmlSecTransformSetKeyMethod setKey; */
542 xmlSecMSCryptoSignatureVerify, /* xmlSecTransformVerifyMethod verify; */
543 xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */
544 xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */
545 xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */
546 NULL, /* xmlSecTransformPushXmlMethod pushXml; */
547 NULL, /* xmlSecTransformPopXmlMethod popXml; */
548 xmlSecMSCryptoSignatureExecute, /* xmlSecTransformExecuteMethod execute; */
550 NULL, /* void* reserved0; */
551 NULL, /* void* reserved1; */
555 * xmlSecMSCryptoTransformRsaSha1GetKlass:
557 * The RSA-SHA1 signature transform klass.
559 * Returns: RSA-SHA1 signature transform klass.
562 xmlSecMSCryptoTransformRsaSha1GetKlass(void) {
563 return(&xmlSecMSCryptoRsaSha1Klass);
566 #endif /* XMLSEC_NO_RSA */
568 #ifndef XMLSEC_NO_DSA
569 /****************************************************************************
571 * DSA-SHA1 signature transform
573 ***************************************************************************/
575 static xmlSecTransformKlass xmlSecMSCryptoDsaSha1Klass = {
576 /* klass/object sizes */
577 sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */
578 xmlSecMSCryptoSignatureSize, /* xmlSecSize objSize */
580 xmlSecNameDsaSha1, /* const xmlChar* name; */
581 xmlSecHrefDsaSha1, /* const xmlChar* href; */
582 xmlSecTransformUsageSignatureMethod, /* xmlSecTransformUsage usage; */
584 xmlSecMSCryptoSignatureInitialize, /* xmlSecTransformInitializeMethod initialize; */
585 xmlSecMSCryptoSignatureFinalize, /* xmlSecTransformFinalizeMethod finalize; */
586 NULL, /* xmlSecTransformNodeReadMethod readNode; */
587 NULL, /* xmlSecTransformNodeWriteMethod writeNode; */
588 xmlSecMSCryptoSignatureSetKeyReq, /* xmlSecTransformSetKeyReqMethod setKeyReq; */
589 xmlSecMSCryptoSignatureSetKey, /* xmlSecTransformSetKeyMethod setKey; */
590 xmlSecMSCryptoSignatureVerify, /* xmlSecTransformVerifyMethod verify; */
591 xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */
592 xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */
593 xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */
594 NULL, /* xmlSecTransformPushXmlMethod pushXml; */
595 NULL, /* xmlSecTransformPopXmlMethod popXml; */
596 xmlSecMSCryptoSignatureExecute, /* xmlSecTransformExecuteMethod execute; */
598 NULL, /* void* reserved0; */
599 NULL, /* void* reserved1; */
603 * xmlSecMSCryptoTransformDsaSha1GetKlass:
605 * The DSA-SHA1 signature transform klass.
607 * Returns: DSA-SHA1 signature transform klass.
610 xmlSecMSCryptoTransformDsaSha1GetKlass(void) {
611 return(&xmlSecMSCryptoDsaSha1Klass);
614 #endif /* XMLSEC_NO_DSA */
616 #ifndef XMLSEC_NO_GOST
617 /****************************************************************************
619 * GOST2001-GOSTR3411_94 signature transform
621 ***************************************************************************/
623 static xmlSecTransformKlass xmlSecMSCryptoGost2001GostR3411_94Klass = {
624 /* klass/object sizes */
625 sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */
626 xmlSecMSCryptoSignatureSize, /* xmlSecSize objSize */
628 xmlSecNameGost2001GostR3411_94, /* const xmlChar* name; */
629 xmlSecHrefGost2001GostR3411_94, /* const xmlChar* href; */
630 xmlSecTransformUsageSignatureMethod, /* xmlSecTransformUsage usage; */
632 xmlSecMSCryptoSignatureInitialize, /* xmlSecTransformInitializeMethod initialize; */
633 xmlSecMSCryptoSignatureFinalize, /* xmlSecTransformFinalizeMethod finalize; */
634 NULL, /* xmlSecTransformNodeReadMethod readNode; */
635 NULL, /* xmlSecTransformNodeWriteMethod writeNode; */
636 xmlSecMSCryptoSignatureSetKeyReq, /* xmlSecTransformSetKeyReqMethod setKeyReq; */
637 xmlSecMSCryptoSignatureSetKey, /* xmlSecTransformSetKeyMethod setKey; */
638 xmlSecMSCryptoSignatureVerify, /* xmlSecTransformVerifyMethod verify; */
639 xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */
640 xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */
641 xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */
642 NULL, /* xmlSecTransformPushXmlMethod pushXml; */
643 NULL, /* xmlSecTransformPopXmlMethod popXml; */
644 xmlSecMSCryptoSignatureExecute, /* xmlSecTransformExecuteMethod execute; */
646 NULL, /* void* reserved0; */
647 NULL, /* void* reserved1; */
651 * xmlSecMSCryptoTransformGost2001GostR3411_94GetKlass:
653 * The GOST2001-GOSTR3411_94 signature transform klass.
655 * Returns: GOST2001-GOSTR3411_94 signature transform klass.
658 xmlSecMSCryptoTransformGost2001GostR3411_94GetKlass(void) {
659 return(&xmlSecMSCryptoGost2001GostR3411_94Klass);
662 #endif /* XMLSEC_NO_GOST*/