[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10074: Move private function declarations from crypto.c into a new (in tor/trunk: . src/common)



Author: nickm
Date: 2007-04-30 18:42:50 -0400 (Mon, 30 Apr 2007)
New Revision: 10074

Modified:
   tor/trunk/
   tor/trunk/src/common/crypto.c
   tor/trunk/src/common/crypto.h
   tor/trunk/src/common/tortls.c
Log:
 r12595@catbus:  nickm | 2007-04-30 18:32:34 -0400
 Move private function declarations from crypto.c into a new #ifdef CRYPTO_PRIVATE block in crypto.h



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r12595] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/common/crypto.c
===================================================================
--- tor/trunk/src/common/crypto.c	2007-04-30 22:42:47 UTC (rev 10073)
+++ tor/trunk/src/common/crypto.c	2007-04-30 22:42:50 UTC (rev 10074)
@@ -54,6 +54,7 @@
 #include <sys/fcntl.h>
 #endif
 
+#define CRYPTO_PRIVATE
 #include "crypto.h"
 #include "log.h"
 #include "aes.h"
@@ -103,11 +104,6 @@
   DH *dh;
 };
 
-/* Prototypes for functions only used by tortls.c */
-crypto_pk_env_t *_crypto_new_pk_env_rsa(RSA *rsa);
-EVP_PKEY *_crypto_pk_env_get_evp_pkey(crypto_pk_env_t *env, int private);
-DH *_crypto_dh_env_get_dh(crypto_dh_env_t *dh);
-
 static int setup_openssl_threading(void);
 static int tor_check_dh_key(BIGNUM *bn);
 

Modified: tor/trunk/src/common/crypto.h
===================================================================
--- tor/trunk/src/common/crypto.h	2007-04-30 22:42:47 UTC (rev 10073)
+++ tor/trunk/src/common/crypto.h	2007-04-30 22:42:50 UTC (rev 10074)
@@ -173,5 +173,12 @@
 void secret_to_key(char *key_out, size_t key_out_len, const char *secret,
                    size_t secret_len, const char *s2k_specifier);
 
+#ifdef CRYPTO_PRIVATE
+/* Prototypes for private functions only used by tortls.c and crypto.c */
+crypto_pk_env_t *_crypto_new_pk_env_rsa(RSA *rsa);
+EVP_PKEY *_crypto_pk_env_get_evp_pkey(crypto_pk_env_t *env, int private);
+DH *_crypto_dh_env_get_dh(crypto_dh_env_t *dh);
 #endif
 
+#endif
+

Modified: tor/trunk/src/common/tortls.c
===================================================================
--- tor/trunk/src/common/tortls.c	2007-04-30 22:42:47 UTC (rev 10073)
+++ tor/trunk/src/common/tortls.c	2007-04-30 22:42:50 UTC (rev 10074)
@@ -17,6 +17,16 @@
  */
 
 #include "orconfig.h"
+
+#include <assert.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/tls1.h>
+#include <openssl/asn1.h>
+#include <openssl/bio.h>
+
+#define CRYPTO_PRIVATE
+
 #include "./crypto.h"
 #include "./tortls.h"
 #include "./util.h"
@@ -27,13 +37,6 @@
 #define LEGAL_NICKNAME_CHARACTERS \
   "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
 
-#include <assert.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#include <openssl/tls1.h>
-#include <openssl/asn1.h>
-#include <openssl/bio.h>
-
 /** How long do identity certificates live? (sec) */
 #define IDENTITY_CERT_LIFETIME  (365*24*60*60)
 
@@ -76,11 +79,6 @@
 #define _TOR_TLS_SYSCALL    (_MIN_TOR_TLS_ERROR_VAL - 2)
 #define _TOR_TLS_ZERORETURN (_MIN_TOR_TLS_ERROR_VAL - 1)
 
-/* These functions are declared in crypto.c but not exported. */
-EVP_PKEY *_crypto_pk_env_get_evp_pkey(crypto_pk_env_t *env, int private);
-crypto_pk_env_t *_crypto_new_pk_env_rsa(RSA *rsa);
-DH *_crypto_dh_env_get_dh(crypto_dh_env_t *dh);
-
 /** Log all pending tls errors at level <b>severity</b>.  Use
  * <b>doing</b> to describe our current activities.
  */