@@ -139,17 +139,17 @@ defmodule ExDTLS do
139
139
140
140
`timeout` is a time in ms after which `handle_timeout/1` should be called.
141
141
"""
142
- @ spec do_handshake ( dtls ( ) ) :: { packets :: binary ( ) , timeout :: integer ( ) }
142
+ @ spec do_handshake ( dtls ( ) ) :: { packets :: [ binary ( ) ] , timeout :: integer ( ) }
143
143
defdelegate do_handshake ( dtls ) , to: Native
144
144
145
145
@ doc """
146
146
Writes data to the DTLS connection.
147
147
148
148
Generates encrypted packets that need to be passed to the second host.
149
149
"""
150
- @ spec write_data ( dtls ( ) , packets :: binary ( ) ) ::
151
- { :ok , packets :: binary ( ) } | { :error , :handshake_not_finished }
152
- defdelegate write_data ( dtls , packets ) , to: Native
150
+ @ spec write_data ( dtls ( ) , data :: binary ( ) ) ::
151
+ { :ok , packets :: [ binary ( ) ] } | { :error , :handshake_not_finished }
152
+ defdelegate write_data ( dtls , data ) , to: Native
153
153
154
154
@ doc """
155
155
Handles peer's packets.
@@ -164,12 +164,12 @@ defmodule ExDTLS do
164
164
165
165
Both local and remote keying materials consist of `master key` and `master salt`.
166
166
"""
167
- @ spec handle_data ( dtls ( ) , packets :: binary ( ) ) ::
167
+ @ spec handle_data ( dtls ( ) , data :: binary ( ) ) ::
168
168
{ :ok , packets :: binary ( ) }
169
169
| :handshake_want_read
170
- | { :handshake_packets , packets :: binary ( ) , timeout :: integer ( ) }
170
+ | { :handshake_packets , packets :: [ binary ( ) ] , timeout :: integer ( ) }
171
171
| { :handshake_finished , local_keying_material :: binary ( ) ,
172
- remote_keying_material :: binary ( ) , protection_profile_t ( ) , packets :: binary ( ) }
172
+ remote_keying_material :: binary ( ) , protection_profile_t ( ) , packets :: [ binary ( ) ] }
173
173
| { :handshake_finished , local_keying_material :: binary ( ) ,
174
174
remote_keying_material :: binary ( ) , protection_profile_t ( ) }
175
175
| { :error , :handshake_error | :peer_closed_for_writing }
@@ -192,6 +192,6 @@ defmodule ExDTLS do
192
192
193
193
If there is no timeout to handle, simple `{:ok, dtls()}` tuple is returned.
194
194
"""
195
- @ spec handle_timeout ( dtls ( ) ) :: :ok | { :retransmit , packets :: binary ( ) , timeout :: integer ( ) }
195
+ @ spec handle_timeout ( dtls ( ) ) :: :ok | { :retransmit , packets :: [ binary ( ) ] , timeout :: integer ( ) }
196
196
defdelegate handle_timeout ( dtls ) , to: Native
197
197
end
0 commit comments