Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.11.0 to 5.13.0. - [Release notes](https://github.com/go-git/go-git/releases) - [Commits](https://github.com/go-git/go-git/compare/v5.11.0...v5.13.0) --- updated-dependencies: - dependency-name: github.com/go-git/go-git/v5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
27 lines
715 B
Go
27 lines
715 B
Go
package packet
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// Padding type represents a Padding Packet (Tag 21).
|
|
// The padding type is represented by the length of its padding.
|
|
// see https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh#name-padding-packet-tag-21
|
|
type Padding int
|
|
|
|
// parse just ignores the padding content.
|
|
func (pad Padding) parse(reader io.Reader) error {
|
|
_, err := io.CopyN(io.Discard, reader, int64(pad))
|
|
return err
|
|
}
|
|
|
|
// SerializePadding writes the padding to writer.
|
|
func (pad Padding) SerializePadding(writer io.Writer, rand io.Reader) error {
|
|
err := serializeHeader(writer, packetPadding, int(pad))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = io.CopyN(writer, rand, int64(pad))
|
|
return err
|
|
}
|