Code Monkey home page Code Monkey logo

go-hibp's Introduction

Hi there, I am Winni ๐Ÿ‘‹

I work in InfoSec and do open source development in my spare time. Music-lover, Record-collector, Go-Enthusiast, Perl-veteran. Vir potens spiritus.

Daily drivers

ย  ย  ย  ย  ย  ย  ย  ย  ย  ย 

Github stats

Winni's github stats

Connect with me

LinkedIn Twitter Mastodon

go-hibp's People

Contributors

freman avatar wneessen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

freman

go-hibp's Issues

Should return http.Response for paste?

In this code:

        hb, hr, err := p.hibp.HTTPResBody(http.MethodGet, apiURL, nil)
	if err != nil {
		return nil, nil, err
	}

the http response is ignored and nil returned if there is any error. However, the error might come from the API call, in which case there could be a response and should be passed down this method as well. Is nil being returned intentionally?

Possible index out of range panic

Stacktrace piece:

out of range [1] with length 1
goroutine 335253 [running]:
runtime/debug. Stack()
/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/debug/stack.go:24 +0x64
/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/panic.go:770 +0x124
github.com/wneessen/go-hibp.(*PwnedPassAPI).ListHashesPrefix(0x1400243cdaD, {0x14003450210,
0x5})
/Users/kenji/.go/pkg/mod/github.com/wneessen/[email protected]/password.go:209 +0x664
github.com/wneessen/go-hibp.(*PwnedPassAPI).CheckSHA1(0x105586fbe?,
(0x14003450210, 0x28})
/Users/kenji/.go/pkg/mod/github.com/wneessen/[email protected]/password.go:77 +0x40
github.com/wneessen/go-hibp. (*PwnedPassAPI).CheckPassword(0x1400243cdaD, {0x140022da510?, 0x14001576690?})
/Users/kenji/โ€ขgo/pkg/mod/github.com/wneessen/[email protected]/password.go:59 +0x1a0

This was caught by our E2Es with random input data, so unfortunately I can't tell if it is some specific input that triggers it or maybe it's a "glitch" in the API output. It did happen on multiple different runs over time, though.
And I'd say it should not panic either way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.