2025-01-19 02:08 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* contrib/hbssl/hbssl.h
  * contrib/hbssl/rsa.c
    * renamed hb_RSA_par_free() to hb_RSA_par_remove()

  * contrib/hbssl/evppkey.c
    * few code clenups

  * contrib/hbssl/x509.c
    ! use GC pointer items instead of raw ones
This commit is contained in:
Przemysław Czerpak
2025-01-19 02:08:01 +01:00
parent fe96da68f6
commit a40aa4baf0
5 changed files with 20 additions and 8 deletions

View File

@@ -7,6 +7,17 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */
2025-01-19 02:08 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbssl/hbssl.h
* contrib/hbssl/rsa.c
* renamed hb_RSA_par_free() to hb_RSA_par_remove()
* contrib/hbssl/evppkey.c
* few code clenups
* contrib/hbssl/x509.c
! use GC pointer items instead of raw ones
2025-01-18 09:33 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbssl/evp.c
* clear key and iv buffers before passing them to EVP_BytesToKey()

View File

@@ -227,19 +227,20 @@ HB_FUNC( EVP_PKEY_ASSIGN )
HB_FUNC( EVP_PKEY_ASSIGN_RSA )
{
#ifndef OPENSSL_NO_RSA
if( hb_EVP_PKEY_is( 1 ) && HB_ISPOINTER( 2 ) )
if( hb_EVP_PKEY_is( 1 ) && hb_RSA_is( 2 ) )
{
EVP_PKEY * pkey = hb_EVP_PKEY_par( 1 );
RSA * key = hb_RSA_par( 2 );
int res = 0;
if( pkey && key )
{
int result = EVP_PKEY_assign_RSA( pkey, key );
res = EVP_PKEY_assign_RSA( pkey, key );
if( result != 0 )
hb_RSA_par_free( 2 );
hb_retni( result );
if( res != 0 )
hb_RSA_par_remove( 2 );
}
hb_retni( res );
}
else
hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );

View File

@@ -219,7 +219,7 @@ extern void hb_X509_ret( X509 * x509, HB_BOOL fRelease );
extern HB_BOOL hb_RSA_is( int iParam );
extern RSA * hb_RSA_par( int iParam );
extern void hb_RSA_par_free( int iParam );
extern void hb_RSA_par_remove( int iParam );
extern void hb_RSA_ret( RSA * rsa );
extern HB_BOOL hb_EVP_MD_is( int iParam );

View File

@@ -81,7 +81,7 @@ RSA * hb_RSA_par( int iParam )
return ph ? ( RSA * ) *ph : NULL;
}
void hb_RSA_par_free( int iParam )
void hb_RSA_par_remove( int iParam )
{
void ** ph = ( void ** ) hb_parptrGC( &s_gcRSA_funcs, iParam );

View File

@@ -156,7 +156,7 @@ HB_FUNC( X509_GET_PUBKEY )
X509 * x509 = hb_X509_par( 1 );
if( x509 )
hb_retptr( X509_get_pubkey( x509 ) );
hb_EVP_PKEY_ret( X509_get_pubkey( x509 ) );
}
else
hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );