-
Notifications
You must be signed in to change notification settings - Fork 58
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
Improve the security of SUCI to SUPI conversion #47
base: main
Are you sure you want to change the base?
Conversation
Will fix the checks, thanks! |
e5d2128
to
a0b3133
Compare
For the following golangci-lint warnings: Error: pkg/suci/suci.go:231:19: SA1019: elliptic.Marshal has been deprecated since Go 1.21: for ECDH, use the crypto/ecdh package. This function returns an encoding equivalent to that of PublicKey.Bytes in crypto/ecdh. (staticcheck)
pubKeyForECDH = elliptic.Marshal(elliptic.P256(), x, y)
^
Error: pkg/suci/suci.go:239:11: SA1019: elliptic.Unmarshal has been deprecated since Go 1.21: for ECDH, use the crypto/ecdh package. This function accepts an encoding equivalent to that of the NewPublicKey methods in crypto/ecdh. (staticcheck)
x, y := elliptic.Unmarshal(elliptic.P256(), transmittedPubKey) Sadly, we don't have the choice to not use these deprecated functions. It's either we use these deprecated functions, or roll out our own functions, which should be avoided in crypto. This PR at least reduces the number of usage of deprecated unsafe functions such as elliptic.ScalarMult. I had opened a Go issue about it yesterday: golang/go#71807 |
…tion to compress/uncompress Profile-B keys instead of rolling out the crypto ourselves
…hat's possible between Profile A and Profile B
Hi! As per new free5gc policy, I've rebased my code upon next branch. Thanks and cheers, |
Hi @linouxis9 Thanks for your contribution. |
@@ -393,24 +392,7 @@ func (p *Processor) GenerateAuthDataProcedure( | |||
sqnStr = fmt.Sprintf("%x", bigSQN) | |||
sqnStr = p.strictHex(sqnStr, 12) | |||
} else { | |||
logger.UeauLog.Errorln("Re-Sync MAC failed ", supiOrSuci) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @linouxis9
I have question about why this part is removed. I think this part can make log message be clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Alonza0314!
I thought that if the SUCI was able to be resolved, it would be better to use it in the log.
If we had an invalid SUCI, it would already had been logged earlier.
But you are right, it's probably clearer for the log flow to show from which SUCI this SUPI is coming from if auth failed! I'll add it back alongside SUPI.
Thanks a ton,
Valentin
Hi!
This PR improves:
This work is part of an going project I'm working on to considerably up the code quality and security of free5gc!
This work is sponsored by Free Mobile!
Hope you find it useful.
CC: @ianchen0119
Thanks and cheers,
Valentin