[Asterisk-cvs] asterisk/include/asterisk crypto.h,1.3,1.4

markster at lists.digium.com markster at lists.digium.com
Fri Sep 17 23:55:49 CDT 2004


Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv10130/include/asterisk

Modified Files:
	crypto.h 
Log Message:
Add extra checks for keys and convenience encrypt/decrypt functions


Index: crypto.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/crypto.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- crypto.h	14 Aug 2004 21:28:30 -0000	1.3
+++ crypto.h	18 Sep 2004 03:59:51 -0000	1.4
@@ -85,6 +85,29 @@
  */
 extern int ast_sign_bin(struct ast_key *key, char *msg, int msglen, unsigned char *sig);
 
+/*!
+ * \param key a private key to use to encrypt
+ * \param src the message to encrypt
+ * \param srclen the length of the message to encrypt
+ * \param dst a pointer to a buffer of at least srclen * 1.5 bytes in which the encrypted
+ * answer will be stored
+ *
+ * Returns length of encrypted data on success or -1 on failure.
+ *
+ */
+extern int ast_encrypt_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key);
+
+/*!
+ * \param key a private key to use to decrypt
+ * \param src the message to decrypt
+ * \param srclen the length of the message to decrypt
+ * \param dst a pointer to a buffer of at least srclen bytes in which the decrypted
+ * answer will be stored
+ *
+ * Returns length of decrypted data on success or -1 on failure.
+ *
+ */
+extern int ast_decrypt_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key);
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif




More information about the svn-commits mailing list