Live data from Hacker News

A TLS 1.3 stack written in Visual Basic 6

github.com

21–30 of 101 posts

Re: A TLS 1.3 stack written in Visual Basic 6

#22
post #19
post #14

Earlier quoted context omitted.

Don’t tell anyone, but I still think we’ve been terrible at UIs since VB6 and Hypercard. We mostly gave up on 2D grids as device resolutions evolved. We made HTML, then made HTML5 as if everything was a blog or newspaper with a navigation bar, semantically (and you still have to learn that the nav contains a bulleted list?) Unfortunately, it became a 3-hour or 3-year or 30-year process for someone to learn “how do I…

I completely agree. I've played with VB6 a few times recently and it feels so fast and natural to make a UI compared to modern frameworks. A bit part of it feels like a dedication to highly polished developer tooling. A strong GUI editor that works with (mostly) zero configuration is a big feature of VB6 to me.

[deleted]

Re: A TLS 1.3 stack written in Visual Basic 6

#23
post #10

It's less than 8kLoC, including what seems to be a bunch of tests at the end, although much of the actual crypto appears to be done using the native advapi32/crypt32/ncrypt libraries. (For those used to OpenSSL, I suppose this could be compared to the libssl part of it.)

The big lines of code in TLS is x.509 certificate parsing, and supporting multiple protocols. If you just want 1.3 and you've got existing cipher and certificate validation libraries to call, it's not too bad. There's some published test vectors to help you get the cipher setup right as well; it gets fiddly, but it's not going to be a lot of code unless you have an Object Extravaganza, and even then, still not too ba…

I implemented TLS without any external deps by supporting only mandatory stuff from the RFC specifications.

DER parsing here: https://github.com/mateuszb/tls1.3/blob/master/der.lisp

Elliptic curves here: https://github.com/mateuszb/tls1.3/blob/master/elliptic-curv...

Protocol records: https://github.com/mateuszb/tls1.3/blob/master/record.lisp

At the time I implemented TLS1.3 there was very little support for it and it seemed like a fun project. The parsing wasn’t the difficult part

Re: A TLS 1.3 stack written in Visual Basic 6

#25
I’m seeing in-line x86 assembly encoded as floating-point constants, implementing what looks like indirect function calls (function pointers?). Is this…normal for advanced VB code? Does VB6 not have any other mechanism for function pointers?

Re: A TLS 1.3 stack written in Visual Basic 6

#27

This is probably the cleanest VB 6 I've seen. Do notice Option Explicit. That is like disabling 90% of the magic that causes unmaintainable code.

The IDE has a setting to always turn it on for new projects. That was a setting I always enabled on new installs. Along with a switch to use SDI instead of MDI.

Re: A TLS 1.3 stack written in Visual Basic 6

#28

I’m seeing in-line x86 assembly encoded as floating-point constants, implementing what looks like indirect function calls (function pointers?). Is this…normal for advanced VB code? Does VB6 not have any other mechanism for function pointers?

> Does VB6 not have any other mechanism for function pointers?

Not really:

https://www.codeproject.com/Articles/19239/Compilers-Demysti...

COM interfaces might count, but that's more of a reference to a COM object which can have many member methods besides a single function (though the concept of using only interface-types to pass around function-pointers is Java's chosen approach, and I don't know anyone who still maintains this was a good idea...)

Re: A TLS 1.3 stack written in Visual Basic 6

#29
Are there still working and available ide and compilers for vb6?

Any open source ones?

After working on vba for MSAccess for a few years I came to both appreciate and hate it.

It’s fast, small in features compared to modern languages, but a pleasure to hack around and find ways to expand its capabilities.

I made simple ORM with it, autogenerating classes from a database, went into the rabbit hole of modernising the dialog box to properly display unicode and make it richer, extended it with string classes taken from .Net, played with COM, the ribbon, etc

Maddening at time but so satisfying to play with. And it was for a useful purpose.

Post reply on HN