Skip to content

Commit

Permalink
Add GNUTL GOST 2001 key
Browse files Browse the repository at this point in the history
  • Loading branch information
lsh123 committed Jul 11, 2023
1 parent 1f858af commit 96297a6
Show file tree
Hide file tree
Showing 14 changed files with 483 additions and 27 deletions.
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ <h1>XML Security Library</h1>
<li>The xmlsec-mscrypto is moved down in the default crypto library selection list as it is now in maintanance mode
(use "--with-default-crypto" option to force the selection).</li>
<li>Fixed the static libraries build with "--enable-static-linking" option on MinGW.</li>
<li>(xmlsec-gnutls) Added support for GOST R 34.11-94 digest and GOST R 34.10-2001 signature algorithms.</li>
<li>Several other small fixes (<a href="https://github.com/lsh123/xmlsec/commits/master">more details</a>).</li>
</ul>
</li>
Expand Down
4 changes: 2 additions & 2 deletions docs/xmldsig.html
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ <h3>XMLSec Cryptographic Libraries features</h3>
<td valign="top">Optional</td><!-- Requirements-->
<td valign="top" bgcolor="#C1E1C1">Yes <a href="#gost-openssl"><sup>(2)</sup></a></td><!-- OpenSSL-->
<td valign="top">No</td><!-- NSS -->
<td valign="top">No</td><!-- GnuTLS -->
<td valign="top">Yes</td><!-- GnuTLS -->
<td valign="top">No</td><!-- MSCng -->
<td valign="top" bgcolor="#C1E1C1">Yes <a href="#gost-mscrypto"><sup>(3)</sup></a></td><!-- MSCrypto -->
<td valign="top">No</td><!-- GCrypt -->
Expand Down Expand Up @@ -1026,7 +1026,7 @@ <h3>XMLSec Cryptographic Libraries features</h3>
<td valign="top">Optional</td><!-- Requirements-->
<td valign="top" bgcolor="#C1E1C1">Yes <a href="#gost-openssl"><sup>(2)</sup></a></td><!-- OpenSSL-->
<td valign="top">No</td><!-- NSS -->
<td valign="top">No</td><!-- GnuTLS -->
<td valign="top">Yes</td><!-- GnuTLS -->
<td valign="top">No</td><!-- MSCng -->
<td valign="top" bgcolor="#C1E1C1">Yes <a href="#gost-mscrypto"><sup>(3)</sup></a></td><!-- MSCrypto -->
<td valign="top">No</td><!-- GCrypt -->
Expand Down
42 changes: 42 additions & 0 deletions include/xmlsec/gnutls/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,48 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecGnuTLSTransformEcdsaSha3_512GetKlas

#endif /* XMLSEC_NO_EC */


/********************************************************************
*
* GOST 2001 key and transforms
*
*******************************************************************/
#ifndef XMLSEC_NO_GOST

/**
* xmlSecGnuTLSKeyDataGost2001Id:
*
* The GOST 2001 key klass.
*/
#define xmlSecGnuTLSKeyDataGost2001Id xmlSecGnuTLSKeyDataGost2001GetKlass ()
XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecGnuTLSKeyDataGost2001GetKlass (void);
XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSKeyDataGost2001AdoptKey (xmlSecKeyDataPtr data,
gnutls_pubkey_t pubkey,
gnutls_privkey_t privkey);
XMLSEC_CRYPTO_EXPORT gnutls_pubkey_t xmlSecGnuTLSKeyDataGost2001GetPublicKey (xmlSecKeyDataPtr data);
XMLSEC_CRYPTO_EXPORT gnutls_privkey_t xmlSecGnuTLSKeyDataGost2001GetPrivateKey(xmlSecKeyDataPtr data);

/**
* xmlSecGnuTLSTransformGostR3411_94Id:
*
* The GOSTR3411_94 digest transform klass.
*/
#define xmlSecGnuTLSTransformGostR3411_94Id \
xmlSecGnuTLSTransformGostR3411_94GetKlass()
XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecGnuTLSTransformGostR3411_94GetKlass(void);

/**
* xmlSecGnuTLSTransformGost2001GostR3411_94Id:
*
* The GOST2001 GOSTR3411_94 signature transform klass.
*/
#define xmlSecGnuTLSTransformGost2001GostR3411_94Id \
xmlSecGnuTLSTransformGost2001GostR3411_94GetKlass()
XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecGnuTLSTransformGost2001GostR3411_94GetKlass(void);

#endif /* XMLSEC_NO_GOST */


/********************************************************************
*
* HMAC transforms
Expand Down
2 changes: 2 additions & 0 deletions include/xmlsec/gnutls/symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ extern "C" {
#define xmlSecTransformSha3_384Id xmlSecGnuTLSTransformSha3_384Id
#define xmlSecTransformSha3_512Id xmlSecGnuTLSTransformSha3_512Id

#define xmlSecTransformGostR3411_94Id xmlSecGnuTLSTransformGostR3411_94Id
#define xmlSecTransformGost2001GostR3411_94Id xmlSecGnuTLSTransformGost2001GostR3411_94Id

/********************************************************************
*
Expand Down
18 changes: 9 additions & 9 deletions include/xmlsec/openssl/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,15 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecOpenSSLTransformEcdhGetKlass(void);
xmlSecOpenSSLKeyDataGost2001GetKlass()
XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecOpenSSLKeyDataGost2001GetKlass (void);

/**
* xmlSecOpenSSLTransformGostR3411_94Id:
*
* The GOSTR3411_94 digest transform klass.
*/
#define xmlSecOpenSSLTransformGostR3411_94Id \
xmlSecOpenSSLTransformGostR3411_94GetKlass()
XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecOpenSSLTransformGostR3411_94GetKlass(void);

/**
* xmlSecOpenSSLTransformGost2001GostR3411_94Id:
*
Expand All @@ -582,15 +591,6 @@ XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecOpenSSLKeyDataGost2001GetKlass (
xmlSecOpenSSLTransformGost2001GostR3411_94GetKlass()
XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecOpenSSLTransformGost2001GostR3411_94GetKlass(void);


/**
* xmlSecOpenSSLTransformGostR3411_94Id:
*
* The GOSTR3411_94 signature transform klass.
*/
#define xmlSecOpenSSLTransformGostR3411_94Id \
xmlSecOpenSSLTransformGostR3411_94GetKlass()
XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecOpenSSLTransformGostR3411_94GetKlass(void);
#endif /* XMLSEC_NO_GOST */


Expand Down
2 changes: 1 addition & 1 deletion include/xmlsec/openssl/symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ extern "C" {
#define xmlSecTransformSha3_384Id xmlSecOpenSSLTransformSha3_384Id
#define xmlSecTransformSha3_512Id xmlSecOpenSSLTransformSha3_512Id

#define xmlSecTransformGost2001GostR3411_94Id xmlSecOpenSSLTransformGost2001GostR3411_94Id
#define xmlSecTransformGostR3411_94Id xmlSecOpenSSLTransformGostR3411_94Id
#define xmlSecTransformGost2001GostR3411_94Id xmlSecOpenSSLTransformGost2001GostR3411_94Id


/********************************************************************
Expand Down
Loading

0 comments on commit 96297a6

Please sign in to comment.