News for hackers. Stuff that matters.
Re:Adam Langley's Pond: Secure Async Messaging by andrewcooke on Saturday July 13, 2013 @09:36PM (#6039526)
(Or, how to better organise a discreet relationship with the Director of the CIA.) from https://github.com/agl/pond (the source) is a good elevator pitch, for people (like me) who are taking their time getting what this is.

also, is code like this https://github.com/agl/pond/blob/master/server/server.go#L15... just extreme defensive programming? or is there some other reason for the check (eg is not everything locked)?

also, does 2. A GPA can learn when messages are sent to a non-home server and which server that is. get weaker if there are many users?

and why is it so quiet here? am i asking dumb questions? i've been deleting the ones i work out answers to!

Re:Adam Langley's Pond: Secure Async Messaging by agwa on Saturday July 13, 2013 @11:00PM (#6039739)
> also, is code like this https://github.com/agl/pond/blob/master/server/server.go#L15... just extreme defensive programming? or is there some other reason for the check (eg is not everything locked)?

That's checking for integer overflow - an often-overlooked source of many security vulnerabilities.

That's a signed integer though, and I don't know if signed integer overflow has defined behavior in Go. In C that would be undefined behavior, allowing the compiler to do potentially nutty things, so you would want to do the overflow check before the increment. (Edit: considering who the author of this code is, I would assume that Go has sane defined behavior on signed integer overflow ;-)

Re:Adam Langley's Pond: Secure Async Messaging by packetslave on Saturday July 13, 2013 @11:09PM (#6039769)
From the Go language spec:

"For signed integers, the operations +, -, *, and << may legally overflow and the resulting value exists and is deterministically defined by the signed integer representation, the operation, and its operands. No exception is raised as a result of overflow. A compiler may not optimize code under the assumption that overflow does not occur. For instance, it may not assume that x < x + 1 is always true."

  func main() {
    var foo int8 = 127
    fmt.Println(foo + 1)
  }
prints -128
Re:Adam Langley's Pond: Secure Async Messaging by agwa on Saturday July 13, 2013 @11:15PM (#6039792)
Cool, thanks for the info!

Looking at the spec, I see that signed integers are elsewhere defined to be represented using 2's complement, so this is completely kosher.

Re:Adam Langley's Pond: Secure Async Messaging by kragen on Sunday July 14, 2013 @03:51AM (#6040276)
I think it's just that nobody knows the answers, mostly. HN is not great for questions that require thought.

Also, btw, I still have your AMOP,a nd it would be awesome to see you again.

Re:Adam Langley's Pond: Secure Async Messaging by andrewcooke on Sunday July 14, 2013 @11:35AM (#6041124)
we've not visited argentina for years so we must be due a trip. if/when we do i'll ping you and you can give me that back during a meal at some nice restaurant...
Re:Adam Langley's Pond: Secure Async Messaging by kragen on Sunday July 14, 2013 @05:56PM (#6042412)
awesome! :)