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

[or-cvs] r10583: Expose a function to parse a private key from a string as CR (in tor/trunk: . src/common)



Author: nickm
Date: 2007-06-13 14:15:53 -0400 (Wed, 13 Jun 2007)
New Revision: 10583

Modified:
   tor/trunk/
   tor/trunk/src/common/crypto.c
   tor/trunk/src/common/crypto.h
Log:
 r13383@catbus:  nickm | 2007-06-13 13:53:04 -0400
 Expose a function to parse a private key from a string as CRYPTO_PRIVATE.  For testing.



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

Modified: tor/trunk/src/common/crypto.c
===================================================================
--- tor/trunk/src/common/crypto.c	2007-06-13 15:37:39 UTC (rev 10582)
+++ tor/trunk/src/common/crypto.c	2007-06-13 18:15:53 UTC (rev 10583)
@@ -413,7 +413,8 @@
 /** Read a PEM-encoded private key from the string <b>s</b> into <b>env</b>.
  * Return 0 on success, -1 on failure.
  */
-static int
+/* Used here, and used for testing. */
+int
 crypto_pk_read_private_key_from_string(crypto_pk_env_t *env,
                                        const char *s)
 {

Modified: tor/trunk/src/common/crypto.h
===================================================================
--- tor/trunk/src/common/crypto.h	2007-06-13 15:37:39 UTC (rev 10582)
+++ tor/trunk/src/common/crypto.h	2007-06-13 18:15:53 UTC (rev 10583)
@@ -176,9 +176,15 @@
 
 #ifdef CRYPTO_PRIVATE
 /* Prototypes for private functions only used by tortls.c and crypto.c */
+typedef struct rsa_st RSA;
+typedef struct evp_pkey_st EVP_PKEY;
+typedef struct dh_st DH;
 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);
+/* Prototypes for private functions only used by crypto.c and test.c*/
+int crypto_pk_read_private_key_from_string(crypto_pk_env_t *env,
+                                           const char *s);
 #endif
 
 #endif