oper

package
v0.0.0-...-df918ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2022 License: ISC Imports: 14 Imported by: 1

Documentation

Overview

Package oper provides utilities for opering up on IRC networks.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChallengeTimeout = errors.New("timed out while waiting on challenge data")
	ErrOperFailed       = errors.New("failed to oper up")
)

Errors related to the automated challenge stuff

Functions

func DoChallenge

func DoChallenge(keypath, password string, ciphertext []byte) (string, error)

DoChallenge decrypts the ciphertext using the given password and key, returns the b64 encoded sha1 hash of the data

Types

type Challenge

type Challenge struct {
	// contains filtered or unexported fields
}

Challenge is a nice wrapper around DoChallenge that manages storing data and decoding b64 for you

func NewChallenge

func NewChallenge(path, password string) (*Challenge, error)

NewChallenge creates a new Challenge instance with the given password and path

func (*Challenge) DoChallenge

func (c *Challenge) DoChallenge(
	handler *irccommand.SimpleHandler, writeIRC func(string, ...string) error, operName string,
) error

DoChallenge performs an IRC CHALLENGE from start to finish. It will block until complete

func (*Challenge) GetResults

func (c *Challenge) GetResults() (string, error)

GetResults executes the below GetResults method with the contents of the buffer

func (*Challenge) OnChallengeMessage

func (c *Challenge) OnChallengeMessage(data *ircmsg.Message) error

OnChallengeMessage is a helper to push data when RPL_RSACHALLENGE2 is received

func (*Challenge) PushData

func (c *Challenge) PushData(data string) error

PushData takes base64 encoded bytes and pushes the contained value onto the Challenge instance's buffer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL