Changeset 140
- Timestamp:
- 05/20/05 22:20:24
- Files:
-
- openpgpsdk/trunk/configure (modified) (3 diffs)
- openpgpsdk/trunk/examples/Makefile.template (modified) (1 diff)
- openpgpsdk/trunk/include/crypto.h (modified) (1 diff)
- openpgpsdk/trunk/src/openssl_crypto.c (modified) (2 diffs)
- openpgpsdk/trunk/src/signature.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/configure
r127 r140 5 5 use Carp; 6 6 7 our %Subst; 7 our %Subst=( 8 'CRYPTO_LIBS' => '-lcrypto', 9 ); 8 10 9 11 my %Args=( … … 16 18 my $loc=shift; 17 19 $Subst{INCLUDES}.=" -I $loc/include"; 20 $Subst{CRYPTO_LIBS}="$loc/libcrypto.a"; 18 21 }, 19 22 '--with-zlib=' => sub { … … 140 143 sub fixSubst { 141 144 foreach my $k (keys %Subst) { 142 $Subst{$k} =~ s/~/ \$(HOME)/g;145 $Subst{$k} =~ s/~/$ENV{HOME}/g; 143 146 } 144 147 } openpgpsdk/trunk/examples/Makefile.template
r137 r140 6 6 LDFLAGS=-g 7 7 LIBDEPS=../src/libops.a 8 LIBS=$(LIBDEPS) -lcrypto-lz $(DM_LIB)8 LIBS=$(LIBDEPS) %CRYPTO_LIBS% -lz $(DM_LIB) 9 9 10 10 all: Makefile lib .depend packet-dump verify create-key create-signed-key openpgpsdk/trunk/include/crypto.h
r136 r140 38 38 size_t length,const ops_rsa_public_key_t *rsa); 39 39 int 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); 41 42 42 43 #endif openpgpsdk/trunk/src/openssl_crypto.c
r136 r140 119 119 120 120 int 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) 122 123 { 123 124 RSA *orsa; … … 125 126 126 127 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; 130 132 131 133 n=RSA_private_encrypt(length,in,out,orsa,RSA_NO_PADDING); 132 134 133 orsa-> d=orsa->p=orsa->q=NULL;135 orsa->n=orsa->d=orsa->p=orsa->q=NULL; 134 136 RSA_free(orsa); 135 137 openpgpsdk/trunk/src/signature.c
r138 r140 46 46 n+=t; 47 47 48 ops_rsa_private_encrypt(sigbuf,hashbuf,keysize,srsa );48 ops_rsa_private_encrypt(sigbuf,hashbuf,keysize,srsa,rsa); 49 49 } 50 50
