adium 5652:822a3f531ef2: Bring back libotr 4.0.0 instead of 3.2.1.
commits at adium.im
commits at adium.im
Wed Jul 10 12:16:58 UTC 2013
details: http://hg.adium.im/adium/rev/822a3f531ef2
revision: 5652:822a3f531ef2
branch: libotr4.0.0
author: Thijs Alkemade <me at thijsalkema.de>
date: Wed Jul 10 14:16:25 2013 +0200
Bring back libotr 4.0.0 instead of 3.2.1.
diffs (truncated from 3519 to 1000 lines):
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Headers
--- a/Frameworks/libotr.framework/Headers Wed Jul 10 14:11:14 2013 +0200
+++ b/Frameworks/libotr.framework/Headers Wed Jul 10 14:16:25 2013 +0200
@@ -1,1 +1,1 @@
-Versions/3.2.1/Headers
\ No newline at end of file
+Versions/4.0.0/Headers
\ No newline at end of file
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Resources
--- a/Frameworks/libotr.framework/Resources Wed Jul 10 14:11:14 2013 +0200
+++ b/Frameworks/libotr.framework/Resources Wed Jul 10 14:16:25 2013 +0200
@@ -1,1 +1,1 @@
-Versions/3.2.1/Resources
\ No newline at end of file
+Versions/4.0.0/Resources
\ No newline at end of file
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/auth.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/auth.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __AUTH_H__
-#define __AUTH_H__
-
-#include <gcrypt.h>
-#include "dh.h"
-
-typedef enum {
- OTRL_AUTHSTATE_NONE,
- OTRL_AUTHSTATE_AWAITING_DHKEY,
- OTRL_AUTHSTATE_AWAITING_REVEALSIG,
- OTRL_AUTHSTATE_AWAITING_SIG,
- OTRL_AUTHSTATE_V1_SETUP
-} OtrlAuthState;
-
-typedef struct {
- OtrlAuthState authstate; /* Our state */
-
- DH_keypair our_dh; /* Our D-H key */
- unsigned int our_keyid; /* ...and its keyid */
-
- unsigned char *encgx; /* The encrypted value of g^x */
- size_t encgx_len; /* ...and its length */
- unsigned char r[16]; /* The encryption key */
-
- unsigned char hashgx[32]; /* SHA256(g^x) */
-
- gcry_mpi_t their_pub; /* Their D-H public key */
- unsigned int their_keyid; /* ...and its keyid */
-
- gcry_cipher_hd_t enc_c, enc_cp; /* c and c' encryption keys */
- gcry_md_hd_t mac_m1, mac_m1p; /* m1 and m1' MAC keys */
- gcry_md_hd_t mac_m2, mac_m2p; /* m2 and m2' MAC keys */
-
- unsigned char their_fingerprint[20]; /* The fingerprint of their
- long-term signing key */
-
- int initiated; /* Did we initiate this
- authentication? */
-
- unsigned int protocol_version; /* The protocol version number
- used to authenticate. */
-
- unsigned char secure_session_id[20]; /* The secure session id */
- size_t secure_session_id_len; /* And its actual length,
- which may be either 20 (for
- v1) or 8 (for v2) */
- OtrlSessionIdHalf session_id_half; /* Which half of the session
- id gets shown in bold */
-
- char *lastauthmsg; /* The last auth message
- (base-64 encoded) we sent,
- in case we need to
- retransmit it. */
-} OtrlAuthInfo;
-
-#include "privkey-t.h"
-
-/*
- * Initialize the fields of an OtrlAuthInfo (already allocated).
- */
-void otrl_auth_new(OtrlAuthInfo *auth);
-
-/*
- * Clear the fields of an OtrlAuthInfo (but leave it allocated).
- */
-void otrl_auth_clear(OtrlAuthInfo *auth);
-
-/*
- * Start a fresh AKE (version 2) using the given OtrlAuthInfo. Generate
- * a fresh DH keypair to use. If no error is returned, the message to
- * transmit will be contained in auth->lastauthmsg.
- */
-gcry_error_t otrl_auth_start_v2(OtrlAuthInfo *auth);
-
-/*
- * Handle an incoming D-H Commit Message. If no error is returned, the
- * message to send will be left in auth->lastauthmsg. Generate a fresh
- * keypair to use.
- */
-gcry_error_t otrl_auth_handle_commit(OtrlAuthInfo *auth,
- const char *commitmsg);
-
-/*
- * Handle an incoming D-H Key Message. If no error is returned, and
- * *havemsgp is 1, the message to sent will be left in auth->lastauthmsg.
- * Use the given private authentication key to sign messages.
- */
-gcry_error_t otrl_auth_handle_key(OtrlAuthInfo *auth, const char *keymsg,
- int *havemsgp, OtrlPrivKey *privkey);
-
-/*
- * Handle an incoming Reveal Signature Message. If no error is
- * returned, and *havemsgp is 1, the message to be sent will be left in
- * auth->lastauthmsg. Use the given private authentication key to sign
- * messages. Call the auth_succeeded callback if authentication is
- * successful.
- */
-gcry_error_t otrl_auth_handle_revealsig(OtrlAuthInfo *auth,
- const char *revealmsg, int *havemsgp, OtrlPrivKey *privkey,
- gcry_error_t (*auth_succeeded)(const OtrlAuthInfo *auth, void *asdata),
- void *asdata);
-
-/*
- * Handle an incoming Signature Message. If no error is returned, and
- * *havemsgp is 1, the message to be sent will be left in
- * auth->lastauthmsg. Call the auth_succeeded callback if
- * authentication is successful.
- */
-gcry_error_t otrl_auth_handle_signature(OtrlAuthInfo *auth,
- const char *sigmsg, int *havemsgp,
- gcry_error_t (*auth_succeeded)(const OtrlAuthInfo *auth, void *asdata),
- void *asdata);
-
-/*
- * Start a fresh AKE (version 1) using the given OtrlAuthInfo. If
- * our_dh is NULL, generate a fresh DH keypair to use. Otherwise, use a
- * copy of the one passed (with the given keyid). Use the given private
- * key to sign the message. If no error is returned, the message to
- * transmit will be contained in auth->lastauthmsg.
- */
-gcry_error_t otrl_auth_start_v1(OtrlAuthInfo *auth, DH_keypair *our_dh,
- unsigned int our_keyid, OtrlPrivKey *privkey);
-
-/*
- * Handle an incoming v1 Key Exchange Message. If no error is returned,
- * and *havemsgp is 1, the message to be sent will be left in
- * auth->lastauthmsg. Use the given private authentication key to sign
- * messages. Call the auth_secceeded callback if authentication is
- * successful. If non-NULL, use a copy of the given D-H keypair, with
- * the given keyid.
- */
-gcry_error_t otrl_auth_handle_v1_key_exchange(OtrlAuthInfo *auth,
- const char *keyexchmsg, int *havemsgp, OtrlPrivKey *privkey,
- DH_keypair *our_dh, unsigned int our_keyid,
- gcry_error_t (*auth_succeeded)(const OtrlAuthInfo *auth, void *asdata),
- void *asdata);
-
-#endif
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/b64.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/b64.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __B64_H__
-#define __B64_H__
-
-#include <stdlib.h>
-
-/* Base64 encodes blocks of this many bytes: */
-#define OTRL_B64_DECODED_LEN 3
-/* into blocks of this many bytes: */
-#define OTRL_B64_ENCODED_LEN 4
-
-/* An encoded block of length encoded_len can turn into a maximum of
- * this many decoded bytes: */
-#define OTRL_B64_MAX_DECODED_SIZE(encoded_len) \
- (((encoded_len + OTRL_B64_ENCODED_LEN - 1) / OTRL_B64_ENCODED_LEN) \
- * OTRL_B64_DECODED_LEN)
-
-/*
- * base64 encode data. Insert no linebreaks or whitespace.
- *
- * The buffer base64data must contain at least ((datalen+2)/3)*4 bytes of
- * space. This function will return the number of bytes actually used.
- */
-size_t otrl_base64_encode(char *base64data, const unsigned char *data,
- size_t datalen);
-
-/*
- * base64 decode data. Skip non-base64 chars, and terminate at the
- * first '=', or the end of the buffer.
- *
- * The buffer data must contain at least ((base64len+3) / 4) * 3 bytes
- * of space. This function will return the number of bytes actually
- * used.
- */
-size_t otrl_base64_decode(unsigned char *data, const char *base64data,
- size_t base64len);
-
-/*
- * Base64-encode a block of data, stick "?OTR:" and "." around it, and
- * return the result, or NULL in the event of a memory error.
- */
-char *otrl_base64_otr_encode(const unsigned char *buf, size_t buflen);
-
-/*
- * Base64-decode the portion of the given message between "?OTR:" and
- * ".". Set *bufp to the decoded data, and set *lenp to its length.
- * The caller must free() the result. Return 0 on success, -1 on a
- * memory error, or -2 on invalid input.
- */
-int otrl_base64_otr_decode(const char *msg, unsigned char **bufp,
- size_t *lenp);
-
-#endif
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/context.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/context.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __CONTEXT_H__
-#define __CONTEXT_H__
-
-#include <gcrypt.h>
-
-#include "dh.h"
-#include "auth.h"
-#include "sm.h"
-
-typedef enum {
- OTRL_MSGSTATE_PLAINTEXT, /* Not yet started an encrypted
- conversation */
- OTRL_MSGSTATE_ENCRYPTED, /* Currently in an encrypted
- conversation */
- OTRL_MSGSTATE_FINISHED /* The remote side has sent us a
- notification that he has ended
- his end of the encrypted
- conversation; prevent any
- further messages from being
- sent to him. */
-} OtrlMessageState;
-
-typedef struct s_fingerprint {
- struct s_fingerprint *next; /* The next fingerprint in the list */
- struct s_fingerprint **tous; /* A pointer to the pointer to us */
- unsigned char *fingerprint; /* The fingerprint, or NULL */
- struct context *context; /* The context to which we belong */
- char *trust; /* The trust level of the fingerprint */
-} Fingerprint;
-
-typedef struct context {
- struct context * next; /* Linked list pointer */
- struct context ** tous; /* A pointer to the pointer to us */
-
- char * username; /* The user this context is for */
- char * accountname; /* The username is relative to
- this account... */
- char * protocol; /* ... and this protocol */
-
- char *fragment; /* The part of the fragmented message
- we've seen so far */
- size_t fragment_len; /* The length of fragment */
- unsigned short fragment_n; /* The total number of fragments
- in this message */
- unsigned short fragment_k; /* The highest fragment number
- we've seen so far for this
- message */
-
- OtrlMessageState msgstate; /* The state of message disposition
- with this user */
- OtrlAuthInfo auth; /* The state of ongoing
- authentication with this user */
-
- Fingerprint fingerprint_root; /* The root of a linked list of
- Fingerprints entries */
- Fingerprint *active_fingerprint; /* Which fingerprint is in use now?
- A pointer into the above list */
- unsigned int their_keyid; /* current keyid used by other side;
- this is set to 0 if we get a
- OTRL_TLV_DISCONNECTED message from
- them. */
- gcry_mpi_t their_y; /* Y[their_keyid] (their DH pubkey) */
- gcry_mpi_t their_old_y; /* Y[their_keyid-1] (their prev DH
- pubkey) */
- unsigned int our_keyid; /* current keyid used by us */
- DH_keypair our_dh_key; /* DH key[our_keyid] */
- DH_keypair our_old_dh_key; /* DH key[our_keyid-1] */
-
- DH_sesskeys sesskeys[2][2]; /* sesskeys[i][j] are the session keys
- derived from DH key[our_keyid-i]
- and mpi Y[their_keyid-j] */
-
- unsigned char sessionid[20]; /* The sessionid and bold half */
- size_t sessionid_len; /* determined when this private */
- OtrlSessionIdHalf sessionid_half; /* connection was established. */
-
- unsigned int protocol_version; /* The version of OTR in use */
-
- unsigned char *preshared_secret; /* A secret you share with this
- user, in order to do
- authentication. */
- size_t preshared_secret_len; /* The length of the above secret. */
-
- /* saved mac keys to be revealed later */
- unsigned int numsavedkeys;
- unsigned char *saved_mac_keys;
-
- /* generation number: increment every time we go private, and never
- * reset to 0 (unless we remove the context entirely) */
- unsigned int generation;
-
- time_t lastsent; /* The last time a Data Message was sent */
- char *lastmessage; /* The plaintext of the last Data Message sent */
- int may_retransmit; /* Is the last message eligible for
- retransmission? */
-
- enum {
- OFFER_NOT,
- OFFER_SENT,
- OFFER_REJECTED,
- OFFER_ACCEPTED
- } otr_offer; /* Has this correspondent repsponded to our
- OTR offers? */
-
- /* Application data to be associated with this context */
- void *app_data;
- /* A function to free the above data when we forget this context */
- void (*app_data_free)(void *);
-
- OtrlSMState *smstate; /* The state of the current
- socialist millionaires exchange */
-} ConnContext;
-
-#include "userstate.h"
-
-/* Look up a connection context by name/account/protocol from the given
- * OtrlUserState. If add_if_missing is true, allocate and return a new
- * context if one does not currently exist. In that event, call
- * add_app_data(data, context) so that app_data and app_data_free can be
- * filled in by the application, and set *addedp to 1. */
-ConnContext * otrl_context_find(OtrlUserState us, const char *user,
- const char *accountname, const char *protocol, int add_if_missing,
- int *addedp,
- void (*add_app_data)(void *data, ConnContext *context), void *data);
-
-/* Find a fingerprint in a given context, perhaps adding it if not
- * present. */
-Fingerprint *otrl_context_find_fingerprint(ConnContext *context,
- unsigned char fingerprint[20], int add_if_missing, int *addedp);
-
-/* Set the trust level for a given fingerprint */
-void otrl_context_set_trust(Fingerprint *fprint, const char *trust);
-
-/* Set the preshared secret for a given fingerprint. Note that this
- * currently only stores the secret in the ConnContext structure, but
- * doesn't yet do anything with it. */
-void otrl_context_set_preshared_secret(ConnContext *context,
- const unsigned char *secret, size_t secret_len);
-
-/* Force a context into the OTRL_MSGSTATE_FINISHED state. */
-void otrl_context_force_finished(ConnContext *context);
-
-/* Force a context into the OTRL_MSGSTATE_PLAINTEXT state. */
-void otrl_context_force_plaintext(ConnContext *context);
-
-/* Forget a fingerprint (so long as it's not the active one. If it's a
- * fingerprint_root, forget the whole context (as long as
- * and_maybe_context is set, and it's PLAINTEXT). Also, if it's not
- * the fingerprint_root, but it's the only fingerprint, and we're
- * PLAINTEXT, forget the whole context if and_maybe_context is set. */
-void otrl_context_forget_fingerprint(Fingerprint *fprint,
- int and_maybe_context);
-
-/* Forget a whole context, so long as it's PLAINTEXT. */
-void otrl_context_forget(ConnContext *context);
-
-/* Forget all the contexts in a given OtrlUserState. */
-void otrl_context_forget_all(OtrlUserState us);
-
-#endif
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/dh.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/dh.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __DH_H__
-#define __DH_H__
-
-#define DH1536_GROUP_ID 5
-
-typedef struct {
- unsigned int groupid;
- gcry_mpi_t priv, pub;
-} DH_keypair;
-
-/* Which half of the secure session id should be shown in bold? */
-typedef enum {
- OTRL_SESSIONID_FIRST_HALF_BOLD,
- OTRL_SESSIONID_SECOND_HALF_BOLD
-} OtrlSessionIdHalf;
-
-typedef struct {
- unsigned char sendctr[16];
- unsigned char rcvctr[16];
- gcry_cipher_hd_t sendenc;
- gcry_cipher_hd_t rcvenc;
- gcry_md_hd_t sendmac;
- unsigned char sendmackey[20];
- int sendmacused;
- gcry_md_hd_t rcvmac;
- unsigned char rcvmackey[20];
- int rcvmacused;
-} DH_sesskeys;
-
-/*
- * Call this once, at plugin load time. It sets up the modulus and
- * generator MPIs.
- */
-void otrl_dh_init(void);
-
-/*
- * Initialize the fields of a DH keypair.
- */
-void otrl_dh_keypair_init(DH_keypair *kp);
-
-/*
- * Copy a DH_keypair.
- */
-void otrl_dh_keypair_copy(DH_keypair *dst, const DH_keypair *src);
-
-/*
- * Deallocate the contents of a DH_keypair (but not the DH_keypair
- * itself)
- */
-void otrl_dh_keypair_free(DH_keypair *kp);
-
-/*
- * Generate a DH keypair for a specified group.
- */
-gcry_error_t otrl_dh_gen_keypair(unsigned int groupid, DH_keypair *kp);
-
-/*
- * Construct session keys from a DH keypair and someone else's public
- * key.
- */
-gcry_error_t otrl_dh_session(DH_sesskeys *sess, const DH_keypair *kp,
- gcry_mpi_t y);
-
-/*
- * Compute the secure session id, two encryption keys, and four MAC keys
- * given our DH key and their DH public key.
- */
-gcry_error_t otrl_dh_compute_v2_auth_keys(const DH_keypair *our_dh,
- gcry_mpi_t their_pub, unsigned char *sessionid, size_t *sessionidlenp,
- gcry_cipher_hd_t *enc_c, gcry_cipher_hd_t *enc_cp,
- gcry_md_hd_t *mac_m1, gcry_md_hd_t *mac_m1p,
- gcry_md_hd_t *mac_m2, gcry_md_hd_t *mac_m2p);
-
-/*
- * Compute the secure session id, given our DH key and their DH public
- * key.
- */
-gcry_error_t otrl_dh_compute_v1_session_id(const DH_keypair *our_dh,
- gcry_mpi_t their_pub, unsigned char *sessionid, size_t *sessionidlenp,
- OtrlSessionIdHalf *halfp);
-
-/*
- * Deallocate the contents of a DH_sesskeys (but not the DH_sesskeys
- * itself)
- */
-void otrl_dh_session_free(DH_sesskeys *sess);
-
-/*
- * Blank out the contents of a DH_sesskeys (without releasing it)
- */
-void otrl_dh_session_blank(DH_sesskeys *sess);
-
-/* Increment the top half of a counter block */
-void otrl_dh_incctr(unsigned char *ctr);
-
-/* Compare two counter values (8 bytes each). Return 0 if ctr1 == ctr2,
- * < 0 if ctr1 < ctr2 (as unsigned 64-bit values), > 0 if ctr1 > ctr2. */
-int otrl_dh_cmpctr(const unsigned char *ctr1, const unsigned char *ctr2);
-
-#endif
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/mem.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/mem.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __MEM_H__
-#define __MEM_H__
-
-void otrl_mem_init(void);
-
-#endif
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/message.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/message.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,210 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __MESSAGE_H__
-#define __MESSAGE_H__
-
-typedef enum {
- OTRL_NOTIFY_ERROR,
- OTRL_NOTIFY_WARNING,
- OTRL_NOTIFY_INFO
-} OtrlNotifyLevel;
-
-typedef struct s_OtrlMessageAppOps {
- /* Return the OTR policy for the given context. */
- OtrlPolicy (*policy)(void *opdata, ConnContext *context);
-
- /* Create a private key for the given accountname/protocol if
- * desired. */
- void (*create_privkey)(void *opdata, const char *accountname,
- const char *protocol);
-
- /* Report whether you think the given user is online. Return 1 if
- * you think he is, 0 if you think he isn't, -1 if you're not sure.
- *
- * If you return 1, messages such as heartbeats or other
- * notifications may be sent to the user, which could result in "not
- * logged in" errors if you're wrong. */
- int (*is_logged_in)(void *opdata, const char *accountname,
- const char *protocol, const char *recipient);
-
- /* Send the given IM to the given recipient from the given
- * accountname/protocol. */
- void (*inject_message)(void *opdata, const char *accountname,
- const char *protocol, const char *recipient, const char *message);
-
- /* Display a notification message for a particular accountname /
- * protocol / username conversation. */
- void (*notify)(void *opdata, OtrlNotifyLevel level,
- const char *accountname, const char *protocol,
- const char *username, const char *title,
- const char *primary, const char *secondary);
-
- /* Display an OTR control message for a particular accountname /
- * protocol / username conversation. Return 0 if you are able to
- * successfully display it. If you return non-0 (or if this
- * function is NULL), the control message will be displayed inline,
- * as a received message, or else by using the above notify()
- * callback. */
- int (*display_otr_message)(void *opdata, const char *accountname,
- const char *protocol, const char *username, const char *msg);
-
- /* When the list of ConnContexts changes (including a change in
- * state), this is called so the UI can be updated. */
- void (*update_context_list)(void *opdata);
-
- /* Return a newly allocated string containing a human-friendly name
- * for the given protocol id */
- const char *(*protocol_name)(void *opdata, const char *protocol);
-
- /* Deallocate a string allocated by protocol_name */
- void (*protocol_name_free)(void *opdata, const char *protocol_name);
-
- /* A new fingerprint for the given user has been received. */
- void (*new_fingerprint)(void *opdata, OtrlUserState us,
- const char *accountname, const char *protocol,
- const char *username, unsigned char fingerprint[20]);
-
- /* The list of known fingerprints has changed. Write them to disk. */
- void (*write_fingerprints)(void *opdata);
-
- /* A ConnContext has entered a secure state. */
- void (*gone_secure)(void *opdata, ConnContext *context);
-
- /* A ConnContext has left a secure state. */
- void (*gone_insecure)(void *opdata, ConnContext *context);
-
- /* We have completed an authentication, using the D-H keys we
- * already knew. is_reply indicates whether we initiated the AKE. */
- void (*still_secure)(void *opdata, ConnContext *context, int is_reply);
-
- /* Log a message. The passed message will end in "\n". */
- void (*log_message)(void *opdata, const char *message);
-
- /* Find the maximum message size supported by this protocol. */
- int (*max_message_size)(void *opdata, ConnContext *context);
-
- /* Return a newly allocated string containing a human-friendly
- * representation for the given account */
- const char *(*account_name)(void *opdata, const char *account,
- const char *protocol);
-
- /* Deallocate a string returned by account_name */
- void (*account_name_free)(void *opdata, const char *account_name);
-
-} OtrlMessageAppOps;
-
-/* Deallocate a message allocated by other otrl_message_* routines. */
-void otrl_message_free(char *message);
-
-/* Handle a message about to be sent to the network. It is safe to pass
- * all messages about to be sent to this routine. add_appdata is a
- * function that will be called in the event that a new ConnContext is
- * created. It will be passed the data that you supplied, as well as a
- * pointer to the new ConnContext. You can use this to add
- * application-specific information to the ConnContext using the
- * "context->app" field, for example. If you don't need to do this, you
- * can pass NULL for the last two arguments of otrl_message_sending.
- *
- * tlvs is a chain of OtrlTLVs to append to the private message. It is
- * usually correct to just pass NULL here.
- *
- * If this routine returns non-zero, then the library tried to encrypt
- * the message, but for some reason failed. DO NOT send the message in
- * the clear in that case.
- *
- * If *messagep gets set by the call to something non-NULL, then you
- * should replace your message with the contents of *messagep, and
- * send that instead. Call otrl_message_free(*messagep) when you're
- * done with it. */
-gcry_error_t otrl_message_sending(OtrlUserState us,
- const OtrlMessageAppOps *ops,
- void *opdata, const char *accountname, const char *protocol,
- const char *recipient, const char *message, OtrlTLV *tlvs,
- char **messagep,
- void (*add_appdata)(void *data, ConnContext *context),
- void *data);
-
-/* Handle a message just received from the network. It is safe to pass
- * all received messages to this routine. add_appdata is a function
- * that will be called in the event that a new ConnContext is created.
- * It will be passed the data that you supplied, as well as
- * a pointer to the new ConnContext. You can use this to add
- * application-specific information to the ConnContext using the
- * "context->app" field, for example. If you don't need to do this, you
- * can pass NULL for the last two arguments of otrl_message_receiving.
- *
- * If otrl_message_receiving returns 1, then the message you received
- * was an internal protocol message, and no message should be delivered
- * to the user.
- *
- * If it returns 0, then check if *messagep was set to non-NULL. If
- * so, replace the received message with the contents of *messagep, and
- * deliver that to the user instead. You must call
- * otrl_message_free(*messagep) when you're done with it. If tlvsp is
- * non-NULL, *tlvsp will be set to a chain of any TLVs that were
- * transmitted along with this message. You must call
- * otrl_tlv_free(*tlvsp) when you're done with those.
- *
- * If otrl_message_receiving returns 0 and *messagep is NULL, then this
- * was an ordinary, non-OTR message, which should just be delivered to
- * the user without modification. */
-int otrl_message_receiving(OtrlUserState us, const OtrlMessageAppOps *ops,
- void *opdata, const char *accountname, const char *protocol,
- const char *sender, const char *message, char **newmessagep,
- OtrlTLV **tlvsp,
- void (*add_appdata)(void *data, ConnContext *context),
- void *data);
-
-/* Send a message to the network, fragmenting first if necessary.
- * All messages to be sent to the network should go through this
- * method immediately before they are sent, ie after encryption. */
-gcry_error_t otrl_message_fragment_and_send(const OtrlMessageAppOps *ops,
- void *opdata, ConnContext *context, const char *message,
- OtrlFragmentPolicy fragPolicy, char **returnFragment);
-
-/* Put a connection into the PLAINTEXT state, first sending the
- * other side a notice that we're doing so if we're currently ENCRYPTED,
- * and we think he's logged in. */
-void otrl_message_disconnect(OtrlUserState us, const OtrlMessageAppOps *ops,
- void *opdata, const char *accountname, const char *protocol,
- const char *username);
-
-/* Initiate the Socialist Millionaires' Protocol */
-void otrl_message_initiate_smp(OtrlUserState us, const OtrlMessageAppOps *ops,
- void *opdata, ConnContext *context, const unsigned char *secret,
- size_t secretlen);
-
-/* Initiate the Socialist Millionaires' Protocol and send a prompt
- * question to the buddy */
-void otrl_message_initiate_smp_q(OtrlUserState us,
- const OtrlMessageAppOps *ops, void *opdata, ConnContext *context,
- const char *question, const unsigned char *secret, size_t secretlen);
-
-/* Respond to a buddy initiating the Socialist Millionaires' Protocol */
-void otrl_message_respond_smp(OtrlUserState us, const OtrlMessageAppOps *ops,
- void *opdata, ConnContext *context, const unsigned char *secret,
- size_t secretlen);
-
-/* Abort the SMP. Called when an unexpected SMP message breaks the
- * normal flow. */
-void otrl_message_abort_smp(OtrlUserState us, const OtrlMessageAppOps *ops,
- void *opdata, ConnContext *context);
-
-#endif
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/privkey-t.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/privkey-t.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __PRIVKEY_T_H__
-#define __PRIVKEY_T_H__
-
-#include <gcrypt.h>
-
-typedef struct s_OtrlPrivKey {
- struct s_OtrlPrivKey *next;
- struct s_OtrlPrivKey **tous;
-
- char *accountname;
- char *protocol;
- unsigned short pubkey_type;
- gcry_sexp_t privkey;
- unsigned char *pubkey_data;
- size_t pubkey_datalen;
-} OtrlPrivKey;
-
-#define OTRL_PUBKEY_TYPE_DSA 0x0000
-
-#endif
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/privkey.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/privkey.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __PRIVKEY_H__
-#define __PRIVKEY_H__
-
-#include <stdio.h>
-#include "privkey-t.h"
-#include "userstate.h"
-
-/* Convert a 20-byte hash value to a 45-byte human-readable value */
-void otrl_privkey_hash_to_human(char human[45], const unsigned char hash[20]);
-
-/* Calculate a human-readable hash of our DSA public key. Return it in
- * the passed fingerprint buffer. Return NULL on error, or a pointer to
- * the given buffer on success. */
-char *otrl_privkey_fingerprint(OtrlUserState us, char fingerprint[45],
- const char *accountname, const char *protocol);
-
-/* Calculate a raw hash of our DSA public key. Return it in the passed
- * fingerprint buffer. Return NULL on error, or a pointer to the given
- * buffer on success. */
-unsigned char *otrl_privkey_fingerprint_raw(OtrlUserState us,
- unsigned char hash[20], const char *accountname, const char *protocol);
-
-/* Read a sets of private DSA keys from a file on disk into the given
- * OtrlUserState. */
-gcry_error_t otrl_privkey_read(OtrlUserState us, const char *filename);
-
-/* Read a sets of private DSA keys from a FILE* into the given
- * OtrlUserState. The FILE* must be open for reading. */
-gcry_error_t otrl_privkey_read_FILEp(OtrlUserState us, FILE *privf);
-
-/* Generate a private DSA key for a given account, storing it into a
- * file on disk, and loading it into the given OtrlUserState. Overwrite any
- * previously generated keys for that account in that OtrlUserState. */
-gcry_error_t otrl_privkey_generate(OtrlUserState us, const char *filename,
- const char *accountname, const char *protocol);
-
-/* Generate a private DSA key for a given account, storing it into a
- * FILE*, and loading it into the given OtrlUserState. Overwrite any
- * previously generated keys for that account in that OtrlUserState.
- * The FILE* must be open for reading and writing. */
-gcry_error_t otrl_privkey_generate_FILEp(OtrlUserState us, FILE *privf,
- const char *accountname, const char *protocol);
-
-/* Read the fingerprint store from a file on disk into the given
- * OtrlUserState. Use add_app_data to add application data to each
- * ConnContext so created. */
-gcry_error_t otrl_privkey_read_fingerprints(OtrlUserState us,
- const char *filename,
- void (*add_app_data)(void *data, ConnContext *context),
- void *data);
-
-/* Read the fingerprint store from a FILE* into the given
- * OtrlUserState. Use add_app_data to add application data to each
- * ConnContext so created. The FILE* must be open for reading. */
-gcry_error_t otrl_privkey_read_fingerprints_FILEp(OtrlUserState us,
- FILE *storef,
- void (*add_app_data)(void *data, ConnContext *context),
- void *data);
-
-/* Write the fingerprint store from a given OtrlUserState to a file on disk. */
-gcry_error_t otrl_privkey_write_fingerprints(OtrlUserState us,
- const char *filename);
-
-/* Write the fingerprint store from a given OtrlUserState to a FILE*.
- * The FILE* must be open for writing. */
-gcry_error_t otrl_privkey_write_fingerprints_FILEp(OtrlUserState us,
- FILE *storef);
-
-/* Fetch the private key from the given OtrlUserState associated with
- * the given account */
-OtrlPrivKey *otrl_privkey_find(OtrlUserState us, const char *accountname,
- const char *protocol);
-
-/* Forget a private key */
-void otrl_privkey_forget(OtrlPrivKey *privkey);
-
-/* Forget all private keys in a given OtrlUserState. */
-void otrl_privkey_forget_all(OtrlUserState us);
-
-/* Sign data using a private key. The data must be small enough to be
- * signed (i.e. already hashed, if necessary). The signature will be
- * returned in *sigp, which the caller must free(). Its length will be
- * returned in *siglenp. */
-gcry_error_t otrl_privkey_sign(unsigned char **sigp, size_t *siglenp,
- OtrlPrivKey *privkey, const unsigned char *data, size_t len);
-
-/* Verify a signature on data using a public key. The data must be
- * small enough to be signed (i.e. already hashed, if necessary). */
-gcry_error_t otrl_privkey_verify(const unsigned char *sigbuf, size_t siglen,
- unsigned short pubkey_type, gcry_sexp_t pubs,
- const unsigned char *data, size_t len);
-
-#endif
diff -r 1af72510ff18 -r 822a3f531ef2 Frameworks/libotr.framework/Versions/3.2.1/Headers/proto.h
--- a/Frameworks/libotr.framework/Versions/3.2.1/Headers/proto.h Wed Jul 10 14:11:14 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- * Off-the-Record Messaging library
- * Copyright (C) 2004-2008 Ian Goldberg, Chris Alexander, Nikita Borisov
- * <otr at cypherpunks.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __PROTO_H__
-#define __PROTO_H__
-
-#include "context.h"
-#include "version.h"
-#include "tlv.h"
-
-/* If we ever see this sequence in a plaintext message, we'll assume the
- * other side speaks OTR, and try to establish a connection. */
-#define OTRL_MESSAGE_TAG_BASE " \t \t\t\t\t \t \t \t "
-/* The following must each be of length 8 */
-#define OTRL_MESSAGE_TAG_V1 " \t \t \t "
-#define OTRL_MESSAGE_TAG_V2 " \t\t \t "
-
-/* The possible flags contained in a Data Message */
-#define OTRL_MSGFLAGS_IGNORE_UNREADABLE 0x01
-
More information about the commits
mailing list