@@ -33,7 +33,6 @@ const (
3333// saltpack message. If err is nil, msgType will return the type of the encoded message, but this does *NOT* guarantee that the
3434// rest of the message is well formed.
3535func IsSaltpackBinary (stream * bufio.Reader ) (msgType MessageType , version Version , err error ) {
36-
3736 b , err := stream .Peek (minLengthToIdentifyBinarySaltpack )
3837 if err == bufio .ErrBufferFull {
3938 return MessageTypeUnknown , Version {}, ErrShortSliceOrBuffer
@@ -48,7 +47,6 @@ func IsSaltpackBinary(stream *bufio.Reader) (msgType MessageType, version Versio
4847// long enough to make this determination, or if it does not appear to contain a binary saltpack message. If err is nil, msgType
4948// will return the type of the encoded message, but this does *NOT* guarantee that the rest of the message is well formed.
5049func IsSaltpackBinarySlice (b []byte ) (msgType MessageType , version Version , err error ) {
51-
5250 // To avoid decoding the whole header, part of the messagepack decoding is done manually
5351 // instead of through go-codec. See https://github.com/msgpack/msgpack/blob/master/spec.md
5452 // for details on the encoding.
@@ -241,7 +239,8 @@ func ClassifyStream(stream *bufio.Reader) (isArmored bool, brand string, message
241239// as well as some informtation about the stream. The brand is only returned for armored ciphertexts, mki only
242240// for encryption-mode ciphertext, senderPublic only for signcryption-mode ciphertexts.
243241func ClassifyEncryptedStreamAndMakeDecoder (source io.Reader , decryptionKeyring SigncryptKeyring , keyResolver SymmetricKeyResolver ) (
244- plainsource io.Reader , msgType MessageType , mki * MessageKeyInfo , senderPublic SigningPublicKey , isArmored bool , brand string , ver Version , err error ) {
242+ plainsource io.Reader , msgType MessageType , mki * MessageKeyInfo , senderPublic SigningPublicKey , isArmored bool , brand string , ver Version , err error ,
243+ ) {
245244 stream := bufio .NewReader (source )
246245
247246 isArmored , _ , msgType , ver , err = ClassifyStream (stream )
0 commit comments