File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -248,13 +248,14 @@ func (w *AuthenticationWriter) seal(b []byte) (*buf.Buffer, error) {
248248 paddingSize = int32 (w .padding .NextPaddingLen ())
249249 }
250250
251- totalSize := encryptedSize + paddingSize
251+ sizeBytes := w .sizeParser .SizeBytes ()
252+ totalSize := sizeBytes + encryptedSize + paddingSize
252253 if totalSize > buf .Size {
253254 return nil , newError ("size too large: " , totalSize )
254255 }
255256
256257 eb := buf .New ()
257- w .sizeParser .Encode (uint16 (encryptedSize + paddingSize ), eb .Extend (w . sizeParser . SizeBytes () ))
258+ w .sizeParser .Encode (uint16 (encryptedSize + paddingSize ), eb .Extend (sizeBytes ))
258259 if _ , err := w .auth .Seal (eb .Extend (encryptedSize )[:0 ], b ); err != nil {
259260 eb .Release ()
260261 return nil , err
You can’t perform that action at this time.
0 commit comments