Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Kill several defines
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
  • Loading branch information
lemenkov committed Oct 18, 2012
1 parent 9ce4d0e commit d125173
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
12 changes: 1 addition & 11 deletions include/zrtp.hrl
Expand Up @@ -87,16 +87,6 @@
-define(ZRTP_SIGNATURE_TYPE_PGP, <<"PGP ">>.).
-define(ZRTP_SIGNATURE_TYPE_X509, <<"X509">>).

-define(ZRTP_SIGNATURE_HELLO, 16#505a).

-define(ZRTP_VERSION, "1.10").
-define(ZRTP_SOFTWARE, <<"Erlang (Z)RTPLIB">>).

-define(HASH_IMAGE_SIZE, 32).

-define(STR_INITIATOR, "Initiator").
-define(STR_RESPONDER, "Responder").

-define(ZRTP_ERROR_MALFORMED_PACKET, 16#10). % Malformed packet (CRC OK, but wrong structure)
-define(ZRTP_ERROR_SOFTWARE, 16#20). % Critical software error
-define(ZRTP_ERROR_UNSUPPORTED_VERSION, 16#30). % Unsupported ZRTP version
Expand Down Expand Up @@ -125,7 +115,7 @@
}).

-record(hello, {
clientid = ?ZRTP_SOFTWARE,
clientid = <<"Erlang (Z)RTPLIB">>,
h3,
zid,
s,
Expand Down
16 changes: 10 additions & 6 deletions src/zrtp.erl
Expand Up @@ -46,6 +46,10 @@

-include("../include/zrtp.hrl").

-define(ZRTP_SIGNATURE_HELLO, 16#505a).

-define(ZRTP_VERSION, "1.10").

-record(state, {
parent = null,
zid,
Expand Down Expand Up @@ -227,14 +231,14 @@ handle_call(
Rs3 = ets:lookup_element(Tid, rs3, 2),
Rs4 = ets:lookup_element(Tid, rs4, 2),

<<Rs1IDi:8/binary, _/binary>> = HMacFun(Rs1, ?STR_INITIATOR),
<<Rs1IDr:8/binary, _/binary>> = HMacFun(Rs1, ?STR_RESPONDER),
<<Rs2IDi:8/binary, _/binary>> = HMacFun(Rs2, ?STR_INITIATOR),
<<Rs2IDr:8/binary, _/binary>> = HMacFun(Rs2, ?STR_RESPONDER),
<<Rs1IDi:8/binary, _/binary>> = HMacFun(Rs1, "Initiator"),
<<Rs1IDr:8/binary, _/binary>> = HMacFun(Rs1, "Responder"),
<<Rs2IDi:8/binary, _/binary>> = HMacFun(Rs2, "Initiator"),
<<Rs2IDr:8/binary, _/binary>> = HMacFun(Rs2, "Responder"),
<<AuxSecretIDi:8/binary, _/binary>> = HMacFun(Rs3, H3),
<<AuxSecretIDr:8/binary, _/binary>> = HMacFun(Rs3, H3),
<<PbxSecretIDi:8/binary, _/binary>> = HMacFun(Rs4, ?STR_INITIATOR),
<<PbxSecretIDr:8/binary, _/binary>> = HMacFun(Rs4, ?STR_RESPONDER),
<<PbxSecretIDi:8/binary, _/binary>> = HMacFun(Rs4, "Initiator"),
<<PbxSecretIDr:8/binary, _/binary>> = HMacFun(Rs4, "Responder"),

{PublicKey, PrivateKey} = ets:lookup_element(Tid, {pki,KeyAgr}, 2),

Expand Down

0 comments on commit d125173

Please sign in to comment.