Changeset 140

Show
Ignore:
Timestamp:
05/20/05 22:20:24
Author:
ben
Message:

Don't die.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openpgpsdk/trunk/configure

    r127 r140  
    55use Carp; 
    66 
    7 our %Subst; 
     7our %Subst=( 
     8            'CRYPTO_LIBS' => '-lcrypto', 
     9           ); 
    810 
    911my %Args=( 
     
    1618              my $loc=shift; 
    1719              $Subst{INCLUDES}.=" -I $loc/include"; 
     20              $Subst{CRYPTO_LIBS}="$loc/libcrypto.a"; 
    1821          }, 
    1922          '--with-zlib=' => sub { 
     
    140143sub fixSubst { 
    141144    foreach my $k (keys %Subst) { 
    142         $Subst{$k} =~ s/~/\$(HOME)/g; 
     145        $Subst{$k} =~ s/~/$ENV{HOME}/g; 
    143146    } 
    144147} 
  • openpgpsdk/trunk/examples/Makefile.template

    r137 r140  
    66LDFLAGS=-g 
    77LIBDEPS=../src/libops.a 
    8 LIBS=$(LIBDEPS) -lcrypto -lz $(DM_LIB) 
     8LIBS=$(LIBDEPS) %CRYPTO_LIBS% -lz $(DM_LIB) 
    99 
    1010all: Makefile lib .depend packet-dump verify create-key create-signed-key 
  • openpgpsdk/trunk/include/crypto.h

    r136 r140  
    3838                           size_t length,const ops_rsa_public_key_t *rsa); 
    3939int ops_rsa_private_encrypt(unsigned char *out,const unsigned char *in, 
    40                             size_t length,const ops_rsa_secret_key_t *rsa); 
     40                            size_t length,const ops_rsa_secret_key_t *srsa, 
     41                            const ops_rsa_public_key_t *rsa); 
    4142 
    4243#endif 
  • openpgpsdk/trunk/src/openssl_crypto.c

    r136 r140  
    119119 
    120120int ops_rsa_private_encrypt(unsigned char *out,const unsigned char *in, 
    121                             size_t length,const ops_rsa_secret_key_t *rsa) 
     121                            size_t length,const ops_rsa_secret_key_t *srsa, 
     122                            const ops_rsa_public_key_t *rsa) 
    122123    { 
    123124    RSA *orsa; 
     
    125126 
    126127    orsa=RSA_new(); 
    127     orsa->d=rsa->d; 
    128     orsa->p=rsa->p; 
    129     orsa->q=rsa->q; 
     128    orsa->n=rsa->n; 
     129    orsa->d=srsa->d; 
     130    orsa->p=srsa->p; 
     131    orsa->q=srsa->q; 
    130132 
    131133    n=RSA_private_encrypt(length,in,out,orsa,RSA_NO_PADDING); 
    132134 
    133     orsa->d=orsa->p=orsa->q=NULL; 
     135    orsa->n=orsa->d=orsa->p=orsa->q=NULL; 
    134136    RSA_free(orsa); 
    135137 
  • openpgpsdk/trunk/src/signature.c

    r138 r140  
    4646    n+=t; 
    4747 
    48     ops_rsa_private_encrypt(sigbuf,hashbuf,keysize,srsa); 
     48    ops_rsa_private_encrypt(sigbuf,hashbuf,keysize,srsa,rsa); 
    4949    } 
    5050