Skip to content

crypto/tls: keysFromMasterSecret() takes len(clientRandom), but should be server #13181

Closed
@RalphCorderoy

Description

@RalphCorderoy

Hi @agl,

keysFromMasterSecret() in crypto/tls/prf.go does

copy(seed[0:len(clientRandom)], serverRandom)
copy(seed[len(serverRandom):], clientRandom)

The first len() should be of serverRandom, not clientRandom. It looks like a copy-and-paste error from the previous masterFromPreMasterSecret(). (They're the same length AFAIK, so no fault occurs.)

But I think both functions could have the first copy() be copy(seed, ...) as used elsewhere in prf.go.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions