Skip to content

Commit

Permalink
2025-01-19 02:08 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
Browse files Browse the repository at this point in the history
  * 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
  • Loading branch information
druzus committed Jan 19, 2025
1 parent fe96da6 commit a40aa4b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
11 changes: 11 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
11 changes: 6 additions & 5 deletions contrib/hbssl/evppkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion contrib/hbssl/hbssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion contrib/hbssl/rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion contrib/hbssl/x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit a40aa4b

Please sign in to comment.