ID Certificates lazarus / 21-General ---------------------------------------------------------------------- fdsingleton · 2024-03-09 19:32 For many years I have developed engineering or scientifically-oriented software (used by myself and a few others) as a sort of a  part-time occupation, and using either a rather old copy of Delphi or the latest Lazarus/Free Pascal.  (See DAofTX.com) Of course, any time I download my own work as a test my Windows says "Do you really want to execute this file from an unknown publisher? etc".  Looking through the internet I find that getting an ID certificate to avoid this confusing and or very expensive for a retired person.   I am wondering if any other Lazarus users have opinions about this situation? ---------------------------------------------------------------------- MarkMLl · 2024-03-10 09:53 Linux users have the opposite problem: no agreed code-signing infrastructure, even for cases where using one would be highly desirable. MarkMLl ---------------------------------------------------------------------- Thaddy · 2024-03-10 19:12 Create your own Certificate Authority (CA) with proper options with e.g. OpenSsl and add that to the keyring. (in windows import certificate.) Then create a codesign certicitate with OpenSsl and sign that with your own CA. Windows will trust your app on your computer. It sees that it is signed and looks up if your own CA is in the keyring. Caveat: if you distribute your software other people also need to import your CA. Which in effect defeats the meaning of codesigning. There are lots of tools on the web that makes the above easy. I do it more or less like that, but I have made a full PKI. There's also a powershell commandlet that can do did for you: https://learn.microsoft.com/en-us/powershell/module/pki/new- selfsignedcertificate?view=windowsserver2022-ps I recently added an example to generated certificates on this forum. If you feel adventurous you can use that as a basis.: https://forum.lazarus.freepascal.org/index.php/topic,66454.msg509273.h tml#msg509273 It creates valid certificates, but is very basic because it is an example on how to start. Note in practice you should generate the private key only once! The example creates both private key and public key every time. But it was all I can do in 40 lines of code to present a "How to". For codesigning it works slightly different but there you also need bothl Btw: I have also a small Powershell goody that is of good use: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $cert = New-SelfSignedCertificate -DNSName "www.yourdomain.com" -CertStoreLocation Cert:\\CurrentUser\\My -Type CodeSigningCert -Subject "Example of Your Code Signing Certificate" ---------------------------------------------------------------------- MarkMLl · 2024-03-11 09:25 Thanks for that Thaddy, I was hoping you'd be able to help so posted to try to keep it visible. MarkMLl ---------------------------------------------------------------------- Joanna · 2024-03-12 00:54 It is kind of troubling that there is no option to tell your computer to “don’t ask again “ At what point will it become impossible to run “unapproved software“ at all? I bet it’s in the works... Our computers that we purchased and own should do what we want them to do, not the other way around ---------------------------------------------------------------------- Thaddy · 2024-03-12 06:12 Joanna, that is why you can self sign your software for use on your own computer. More in general I am a big fan of properly signed software with a certificate issued by one of the big trusted certificate authorities. To name a few good reasons: - Such software can hardly be tampered with. - The creator of properly signed software is always traceable: that is why you pay for trusted certificates, an audit is done, depending on the category of the certificate a pretty hefty audit. You do not pay for the material certificate as such, because they are easy to generate. - Software that accesses low level resources e.g. port scanners etc will not trigger anti-virus software - Software created by less well known compilers will not trigger heuristics in a virus scanner (like we experience sometimes with Freepascal) - If malicious software happens to be signed, the certificate can be revoked. - For all these reasons it makes computers and the internet safer. So in a commercial setting it is pretty much mandatory. Usually you and I do not need to sign the software during development, you only self-sign to test the behavior. Technically there is one big difference in generating certificates by a trusted CA and your self generated certificates: They take the needed random entropy from a truely random source, like from radioactive decay, although you can buy such a black box yourself, not expensive anymore,  and modern computers can take their random entropy from the PC hardware which is nearly just as good: hwrand on Unix,  Microsoft crypting uses hardware entropy too. The certificates are also generated in clean room, without exposure to external sources. ---------------------------------------------------------------------- MarkMLl · 2024-03-12 07:02 Quote from: Thaddy on March 12, 2024, 07:12:51 amMore in general I am a big fan of properly signed software with a certificate issued by one of the big trusted certificate authorities. I generally agree, provided that there is some way to keep working if a computer doesn't have Internet access. That combination will normally assume that the entire execution chain- from bootcode in ROM to application- is locked down hard. Leading on from that I'd like to highlight Joanna's QuoteOur computers that we purchased and own should do what we want them to do, not the other way around  I'm a firm believer in "It's my PC and I'll pry if I want to". However what I don't have a right to do is to pretend to other members of the global community that I'm using a computer which is in totally virgin condition when in fact I've tweaked some apparently-innocuous setting, or to fiddle with some middleware library and then ask the originator to support my changes. I normally make that point when arguing against totally-open environments like Smalltalk, but I feel that they apply equally even when using a "conventional" operating system. Those of us with long memories might recall that it's only over the last five years or so that banks etc. have been fairly happy with open-source OSes and browsers, and I'd rather not lose that. MarkMLl ---------------------------------------------------------------------- Joanna · 2024-03-12 09:51 Anything that requires permission from a third party to run stuff on your computer is not a good trend. Sure you can make self signed certificates for now. But you shouldn’t have to. What is possible now is not guaranteed to be possible in the future. Websites are already denying access to people with unapproved/out of date browsers. It has happened to me several times already. I go to a website and get sent to a boring page that says “you are using an unsupported browser” and shows a rather short list of acceptable browsers. Some of the websites I would not even consider high security sites. ---------------------------------------------------------------------- Thaddy · 2024-03-12 10:12 That is simply because you try to connect with an outdated protocol e.g SSL3, TLS 1.0 or lower. The browsers do that on purpose to protect you. These protocols are deemed unsafe. ---------------------------------------------------------------------- colo · 2024-03-12 14:41 @Thaddy: No, that is not the reason - at least not exclusively. Some websites also decide that after the HTTP(S) protocol has already established am means of communication, by evaluating your browser's User-Agent string, or by fingerprinting a browser's feature availability (WebRTC, Canvas elements), even though they do not necessarily rely on these tested features for delivering the information requested. It happens to users of "minority" browsers (read: browser engines that are neither Safari nor Blink/Chrome) on a regular basis, and it is a VERY bad trend. Code signing as well as other attempts at remote attestation provide a false sense of security, and, I believe (and fear), ultimately threaten general purpose computing. ---------------------------------------------------------------------- Joanna · 2024-03-12 14:49 The new software written by the same people who made unsafe software is probably not safe either  . Oh I get it, if software is brand new it’s safe but it has planned obsolescence and expires after a short time to keep us on a never ending treadmill of updating and upgrading devices. A website has no business ordering me what browser to use in my opinion. ---------------------------------------------------------------------- Thaddy · 2024-03-12 15:36 Well install a server as localhost... And let your out of date browser use that server. Note you need to recompile e.g. openssl from source with the legacy flag enabled otherwise your own server will also refuse that browser. I believe fcl-net/web also blocks outdated protocols by default. At least ssl2 and below, but I think also tls 1.0 and ssl3. It chooses highest available as default, which is tls1.3 with fallback to tls1.2 These no longer conform to web standards. Besides fcl-web needs either openssl or another crypto provider and these have those vulnerable protocol disabled. (As I wrote, you can compile openssl with the legacy flag if you think you need it, which is stupid) They are withdrawn from the RFC's. Your internet browser experience will become very limited, of course  Here is an overview: https://en.wikipedia.org/wiki/Version_history_for_TLS/SSL_support_in_w eb_browsers Note that using insecure protocols does not only expose you, but also the server to vulnerabilities caused by using an insecure protocol. E.g. Poodle attacks. Joanna, your position is stubborn and very, very wrong. Change your mind quickly. I am being very polite here. I can write a rant too if you prefer... ---------------------------------------------------------------------- PascalDragon · 2024-03-12 20:36 Quote from: MarkMLl on March 12, 2024, 08:02:40 amQuote from: Thaddy on March 12, 2024, 07:12:51 amMore in general I am a big fan of properly signed software with a certificate issued by one of the big trusted certificate authorities. I generally agree, provided that there is some way to keep working if a computer doesn't have Internet access. That combination will normally assume that the entire execution chain- from bootcode in ROM to application- is locked down hard. You usually have the corresponding root certificates in your system's certificate store. Internet access is only required to check the revocation list URL provided in the certificate, but not for verification of the certificate (and the clock needs to be set more or less correctly). ---------------------------------------------------------------------- Thaddy · 2024-03-12 21:31 There are two things playing in this discussion: - Signed software - Secure connection The first means your software is signed by a trusted CA and can run without any internet connection. The CA certificate must be present on your computer and it usually is. And only at install time. The second means that the server gives you a choice of protocols that it will accept. This is transparent to the user unless the case of Joanna, where the connection is flatly refused because her browser wants to connect with an obsolete protocol. PascalDragon is very right about the clock, btw, I forgot to mention that. Certificates contain a creation date and an expiry date ao. For code signing that does not matter too much. Once signed with a valid certificate it will always work ---------------------------------------------------------------------- Joanna · 2024-03-12 22:36 Thaddy I don’t know much about this type of computing but why are protocols becoming obselete so often? That doesn’t sound like a very good design to begin with. Whatever is popular that is being used right now is probably full of backdoors and vulnerabilities,  it just hasn’t been declared yet. So far as I can tell the majority of the population has been lured into becoming completely dependent upon computers and now there is no easy way to go back as computing and software are transforming into something not so enjoyable. Nobody should Ever have to get permission from a third party nor jump through hoops to run software they want on their own machine Yet that’s where we are headed. These sorts of things always start off with easy workarounds and once the majority of people are on board with them the training wheels are removed and the access To things that were once taken for granted becomes very difficult. ---------------------------------------------------------------------- Thaddy · 2024-03-13 05:55 Transport Protocols - and their underlying cryptography - are not obsoleted very much, only when e.g. an attack vector is discovered. It can be that the maths behind a protocol is essentially sound but that an exception is discovered in practice. That is for example the case with md5 encryption, which is mathematically sound, except if one uses a specific initialization vector. (IV) In general one can test protocols only by mathematics and use verification, whereas obsoleting is done by (Karl Popper's) falsification, i.e. one counter example is enough to prove the theory is wrong. Once proven wrong, you must obsolete because you can bring yourself and other people in a harmful situation. Ransomware, for example, is usually reliant knowing such flaws and exploiting them. I can predict that if you use SSE2 over the internet at some point your hard drive will be encrypted by someone else. The higher the exposure, the more likely it is that you will be attacked. This is just an example why it is important to keep your browser up-to-date. ---------------------------------------------------------------------- MarkMLl · 2024-03-13 07:44 Quote from: Joanna on March 12, 2024, 11:36:20 pmThaddy I don’t know much about this type of computing but why are protocols becoming obselete so often? In that case stop talking about it and use this as a learning exercise. Public protocols don't generally go obsolete. They do, on the other hand, sometimes have architectural problems which causes them- usually gradually- to be superceded by an improved version with an API which is as compatible as possible. As a specific example, the transition from the original SSL to the currently-preferred TLS took more than ten years: probably 20ish. There are, however, two glaring exceptions: i) Application-level protocols between e.g. a server at YourBank and Javascript code running in your browser exist entirely at their author's whim. If you can demonstrate that the reason your browser-of- choice is no longer adequate for no good reason then the people to kvetch at are YourBank and the bodies that regulate them, NOT HERE. ii) Certain middleware software, in particular anything related to Gnome including GTK, have notoriously unstable APIs. This means that if YourBank mandates that a particular variant of Javascript and a particular version of TLS is to be used, which implies that a particular version of browser be used, that is very likely to imply that a very specific version of Linux is to be used as the underlying layer. To its credit, the MS-based family of OSes etc. is rather more stable. Now I'm sorry if some of that was less than courteous to a naive little lady like yourself, but this is not the place for the sort of ill-informed rants which you seem to favour. MarkMLl ---------------------------------------------------------------------- Joanna · 2024-03-13 13:40 Well at least you managed to teach me a new word “ kvetch”