[or-cvs] Tested backends for directory signing and checking. Direct...
Nick Mathewson
nickm at seul.org
Wed May 7 18:30:48 UTC 2003
Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv22193/src/common
Modified Files:
crypto.c crypto.h
Log Message:
Tested backends for directory signing and checking. Directory parser completely refactored. Need documentation and integration. Explanitory mail forthcoming.
Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- crypto.c 7 May 2003 02:28:42 -0000 1.17
+++ crypto.c 7 May 2003 18:30:46 -0000 1.18
@@ -551,10 +551,8 @@
switch(env->type) {
case CRYPTO_PK_RSA:
- if (!(((RSA*)env->key)->p))
- return -1;
return RSA_public_decrypt(fromlen, from, to, (RSA *)env->key,
- RSA_PKCS1_OAEP_PADDING);
+ RSA_PKCS1_PADDING);
default:
return -1;
}
@@ -569,7 +567,7 @@
if (!(((RSA*)env->key)->p))
return -1;
return RSA_private_encrypt(fromlen, from, to, (RSA *)env->key,
- RSA_PKCS1_OAEP_PADDING);
+ RSA_PKCS1_PADDING);
default:
return -1;
}
@@ -836,7 +834,7 @@
EVP_EncodeInit(&ctx);
EVP_EncodeUpdate(&ctx, dest, &len, src, srclen);
- EVP_EncodeFinal(&ctx, dest, &ret);
+ EVP_EncodeFinal(&ctx, dest+len, &ret);
ret += len;
return ret;
}
Index: crypto.h
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- crypto.h 7 May 2003 02:28:42 -0000 1.10
+++ crypto.h 7 May 2003 18:30:46 -0000 1.11
@@ -65,7 +65,7 @@
int crypto_pk_public_encrypt(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to, int padding);
int crypto_pk_private_decrypt(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to, int padding);
int crypto_pk_private_sign(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to);
-int crypto_pk_private_checksig(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to);
+int crypto_pk_public_checksig(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to);
int base64_encode(char *dest, int destlen, char *src, int srclen);
int base64_decode(char *dest, int destlen, char *src, int srclen);
More information about the tor-commits
mailing list