File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ impl StreamingEncryptingKey {
136
136
return Err ( Unspecified ) ;
137
137
}
138
138
let outlen: usize = outlen. try_into ( ) ?;
139
+ debug_assert ! ( outlen <= min_outsize) ;
139
140
Ok ( BufferUpdate :: new ( output, outlen) )
140
141
}
141
142
@@ -167,6 +168,7 @@ impl StreamingEncryptingKey {
167
168
return Err ( Unspecified ) ;
168
169
}
169
170
let outlen: usize = outlen. try_into ( ) ?;
171
+ debug_assert ! ( outlen <= self . algorithm( ) . block_len( ) ) ;
170
172
Ok ( ( self . context . into ( ) , BufferUpdate :: new ( output, outlen) ) )
171
173
}
172
174
@@ -322,6 +324,7 @@ impl StreamingDecryptingKey {
322
324
return Err ( Unspecified ) ;
323
325
}
324
326
let outlen: usize = outlen. try_into ( ) ?;
327
+ debug_assert ! ( outlen <= min_outsize) ;
325
328
Ok ( BufferUpdate :: new ( output, outlen) )
326
329
}
327
330
@@ -345,6 +348,7 @@ impl StreamingDecryptingKey {
345
348
return Err ( Unspecified ) ;
346
349
}
347
350
let outlen: usize = outlen. try_into ( ) ?;
351
+ debug_assert ! ( outlen <= self . algorithm( ) . block_len( ) ) ;
348
352
Ok ( BufferUpdate :: new ( output, outlen) )
349
353
}
350
354
You can’t perform that action at this time.
0 commit comments