Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/rsa: PublicKey.Equal() should say it expects a pointer #49136

Open
Tracked by #57752
glad-dev opened this issue Oct 24, 2021 · 3 comments
Open
Tracked by #57752

crypto/rsa: PublicKey.Equal() should say it expects a pointer #49136

glad-dev opened this issue Oct 24, 2021 · 3 comments
Labels
Documentation NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@glad-dev
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.17 linux/amd64

Does this issue reproduce with the latest release?

N/A

What operating system and processor architecture are you using (go env)?

N/A but included below

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/bernd/.cache/go-build"
GOENV="/home/bernd/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/bernd/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/bernd/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/mnt/c/Users/User/Programming/Go/playground/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1064618544=/tmp/go-build -gno-record-gcc-switches"

What did you do?

N/A

What did you expect to see?

I expected the documentation or the function signature to mention that publicKey.Equal expects a pointer instead of a value.

What did you see instead?

Neither the function signature nor the documentation makes it clear that publicKey.Equal expects a pointer instead of a value

@glad-dev glad-dev changed the title Update the documentation or the function siganature of rsa.PublicKey.Equal Update the documentation or the function signature of rsa.PublicKey.Equal Oct 24, 2021
@seankhliao seankhliao changed the title Update the documentation or the function signature of rsa.PublicKey.Equal crypto/rsa: PublicKey.Equal() should say it expects a pointer Oct 24, 2021
@seankhliao
Copy link
Member

cc @FiloSottile

@seankhliao seankhliao added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Oct 24, 2021
@seankhliao seankhliao added this to the Unplanned milestone Aug 20, 2022
qiulaidongfeng added a commit to qiulaidongfeng/go that referenced this issue Oct 3, 2023
…s a pointer

Fixes golang#49136
For golang#57752

Change-Id: I6199ee5e1aa3b1ea7a152f5a5321d2c474a7781c
@gopherbot
Copy link

Change https://go.dev/cl/532335 mentions this issue: crypto/rsa: PublicKey.Equal() documentation specifies that it requires a pointer

qiulaidongfeng added a commit to qiulaidongfeng/go that referenced this issue Dec 9, 2023
…s a pointer

Fixes golang#49136
For golang#57752

Change-Id: I6199ee5e1aa3b1ea7a152f5a5321d2c474a7781c
qiulaidongfeng added a commit to qiulaidongfeng/go that referenced this issue Jan 9, 2024
…s a pointer

Fixes golang#49136
For golang#57752

Change-Id: I6199ee5e1aa3b1ea7a152f5a5321d2c474a7781c
@randall77
Copy link
Contributor

I'm confused by the confusion here. Sure, it is a mistake to pass a rsa.PublicKey instead of a *rsa.PublicKey to Equal. But how are you coming up with that rsa.PublicKey value? It is going to be useless in lots of places, not just as an argument to crypto/rsa.PublicKey.Equal. It doesn't have any methods and everything that might use it as a public key would barf on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants