Munging ssh key formats

2010-06-18 Thread Philip Prindeville
I have a key file that looks like: BEGIN SSH2 PUBLIC KEY Comment: rsa-key-20100318 ... END SSH2 PUBLIC KEY How do I use openssl rsa ... to munge this into the format suitable for ~/.ssh/authorized_keys ? Thanks, -Philip

OT: Using openssl commands to generate VPN (ipsec-tools) self-signed certificates for authentication

2010-09-21 Thread Philip Prindeville
Hi. I'm trying to transition from using PSK's with ipsec-tools to self-signed certs (harder to guess, etc) but I've not been very successful. When it fails, it's not always apparent why it fails... that's the nature of security, of course. I was wondering if anyone else had done this, and

Looking for an updated programming book...

2014-11-14 Thread Philip Prindeville
Hi. I’ve been using the O’Reilly “Network security with OpenSSL” book, but it’s showing its age. It was published in 2002 and covered version 0.9.7. Since then a lot of RFCs have been published, weaknesses reported and fixed, new functionality added… It’s time to give up my beloved book for

CMS question on encrypting and signing

2014-11-14 Thread Philip Prindeville
Hi. I’m working on an application that requires datagrams of ASN.1 PDU’s to be exchanged. The application data needs to be first encrypted, then signed. I will not be using streams, but rather memory BIO’s. I could use the CMS_encrypt() into one BIO, then reset that and pass it as input to

Re: X.509 Public Key Fingerprints

2014-11-20 Thread Philip Prindeville
Did you ever get anywhere on this? I’m also looking for a function to generate a fingerprint (either MD5 or SHA-1 digest) over a public key DER string. Thanks. On Aug 15, 2012, at 2:53 AM, Curt Sampson c...@cynic.net wrote: I'm designing a protocol that requests certificates for specific

Re: [openssl-users] Freeze to mailing list memberships

2014-12-05 Thread Philip Prindeville
On Dec 5, 2014, at 1:57 PM, Walter H. walte...@mathemainzel.info wrote: On 05.12.2014 21:46, Kurt Roeckx wrote: On Fri, Dec 05, 2014 at 07:34:13PM +, TJ wrote: On 26/11/14 02:05, Salz, Rich wrote: We will soon be freezing the mailing list memberships for a couple of days. We are moving

Re: [openssl-users] OpenSSL mail outage tomorrow 1200-1400UTC

2014-12-22 Thread Philip Prindeville
And that's back up and working, right? I've not seen any messages today, but then again it's the holidays... On 12/22/2014 08:56 AM, Steve Marquess wrote: We've been experiencing some issues with the system that handles @openssl.org E-mail and the mailing lists. The hardware vendor will be

[openssl-users] Updating (re-issuing) self-signed cert with keyid, issuer, serial AKI

2017-02-16 Thread Philip Prindeville
Hi. I have the following certificate (below) and I’m trying to generate a new self-signed cert from it, but when I do so the issuer+serial get dropped from it. Looking at the CSR that gets generated as an intermediate step, I’m not seeing that information there. What do I need to do to "copy

Re: [openssl-users] Shutdown details

2018-08-10 Thread Philip Prindeville
Hi. This is something that I’m also interested, as a contributor to Libevent, which provides SSL-socket support. I’ve opened an OpenSSL issue: https://github.com/openssl/openssl/issues/6911 to collect the details on how a graceful shutdown can

Re: [openssl-users] Multi client DTLS server on OpenSSL 1.1.x broken?

2018-08-15 Thread Philip Prindeville
> On Aug 15, 2018, at 2:09 PM, Richard Weinberger wrote: > > Philip, > > Am Mittwoch, 15. August 2018, 21:36:30 CEST schrieben Sie: >> >>> [snip] >> >> >> Have you tried using Libevent? It supports SSL/TLS/DTLS connections. > > Can you please explain? I fear I miss something. Have a

Re: [openssl-users] Multi client DTLS server on OpenSSL 1.1.x broken?

2018-08-15 Thread Philip Prindeville
> On Aug 11, 2018, at 9:22 AM, Richard Weinberger wrote: > > Hi! > > I have a hard time figuring how to write a DTLS UDP server that supports > multiple > clients. My dummy single user server works fine. > > To support multiple clients I tried two approaches: > 1. singled threaded async

Re: Creating a CSR using OpenSSL v1.1.1

2021-10-12 Thread Philip Prindeville
> On Apr 29, 2021, at 8:15 AM, Matt Caswell wrote: > > > On 29/04/2021 15:04, Joe Eremita wrote: >> datasig_len = i2d_X509_REQ_INFO( req->req_info, NULL ); > > You can achieve this by instead doing: > > datasig_len = i2d_re_X509_REQ_tbs(req, NULL); > > See: > >

Examples of adding Private Enterprise Numbers (PEN's) Extensions to CSR

2021-10-14 Thread Philip Prindeville
Hi, I need to generate CSR's with some Extensions included that use our PEN's as allocated by IANA. Are there any examples of this? Also, I'm looking at X509_REQ_add_extensions_nid() and it takes a STACK_OF(X509_EXTENSION) but it doesn't seem to actually iterate through the stack... Is this

Re: PKCS#10 CSR generation and bulky crypto library - Re: Questions about legacy apps/req.c code

2021-12-22 Thread Philip Prindeville
> On Dec 22, 2021, at 2:18 PM, Jordan Brown > wrote: > > On 12/22/2021 11:45 AM, David von Oheimb wrote: >> Yet beware that a general-purpose library function that has (at least) the >> flexibility offered by that app would need a non-trivial set of parameters. >> > > I suspect that it

Re: Questions about legacy apps/req.c code

2021-12-22 Thread Philip Prindeville
'd love to see another libcrypto/libssl > client library (libx509, maybe?) be used for the more esoteric aspects of > creating and verifying certificates. > > -Kyle H > > On Tue, Dec 21, 2021, 22:25 Philip Prindeville > wrote: > Hi, > > I'm trying to add a library ro

Questions about legacy apps/req.c code

2021-12-21 Thread Philip Prindeville
Hi, I'm trying to add a library routine (or routines) to generate a CSR and make that available to users of Openssl at the API level. I'm thinking the shortest path might be to extract code from apps/req.c as we know it's correct. My only problem (so far) is dealing with the multiple places

Re: [openssl-users] Verifying Android hardware attestation certificates with OpenSSL

2021-07-22 Thread Philip Prindeville
Did you ever get to the root of this? -Philip > On Oct 30, 2018, at 5:52 PM, Pietu Pohjalainen wrote: > > Dear all, > > I have been trying to verify hardware attestation certificates originating > from different Android phones with the OpenSSL tool. There seems to be not > too much

iOS app attest server side

2021-07-22 Thread Philip Prindeville
Hi all, Does anyone have any reference code for implementing server-side App Attest for iOS clients? Thanks, -Philip

Parsing subject/issuer strings in X.509

2021-07-22 Thread Philip Prindeville
Hi, I'm wondering what the function is that takes a string and returns X509_NAME with the attribute/value pairs of the parsed DN. Thanks, -Philip

Re: Parsing subject/issuer strings in X.509

2021-07-23 Thread Philip Prindeville
multi-valued RDNs if canmulti > * and characters may be escaped by \ > */ > X509_NAME *parse_name(const char *cp, int chtype, int canmulti, const char > *desc) > > Would be good to have such a function as part of the X.509 API. > > David > > On 23.07.

Re: Parsing subject/issuer strings in X.509

2021-07-23 Thread Philip Prindeville
> On Jul 23, 2021, at 8:52 AM, Viktor Dukhovni > wrote: > >> On 23 Jul 2021, at 2:57 am, David von Oheimb wrote: >> >> What I use is >> >>X509_NAME *nname = parse_name(string, MBSTRING_ASC, 1, desc); >> >> which is not an official API function but defined in apps/lib/apps.c: >>

Re: Parsing subject/issuer strings in X.509

2021-07-23 Thread Philip Prindeville
multi-valued RDNs if canmulti > * and characters may be escaped by \ > */ > X509_NAME *parse_name(const char *cp, int chtype, int canmulti, const char > *desc) > > Would be good to have such a function as part of the X.509 API. > > David > > On 23.07.

Autoconf and detecting if bio_st is defined or not

2022-03-25 Thread Philip Prindeville
Hi, I was wondering if there was some sort of sentinel variable that tells us if is exporting access to the bio_st structure, or not. Thanks, -Philip

Cross-project request... looking for input on a rewrite of Asterisk's res_crypto.c module

2022-03-29 Thread Philip Prindeville
Hi, I'm trying to develop a newer replacement module for Asterisk's res_crypto that is (for now) 1.1.x compatible but can be easily updated to 3.0 (and maybe even easily add provider support for TPM escrowed secrets, etc). I'm collecting requirements before I get started.

Re: Cross-project request... looking for input on a rewrite of Asterisk's res_crypto.c module

2022-03-31 Thread Philip Prindeville
> On Mar 30, 2022, at 10:25 AM, William Roberts > wrote: > > On Tue, Mar 29, 2022 at 3:40 PM Philip Prindeville > wrote: >> >> Hi, >> >> I'm trying to develop a newer replacement module for Asterisk's res_crypto >> that is (for now) 1.1.

Porting asterisk to Openssl-3.0

2022-03-24 Thread Philip Prindeville
Hi, I'm incrementally trying to port asterisk to Openssl 3.0. First thing I'm trying to do is wean the code off of the RSA_* functions, and use generic EVP_PKEY_* functions instead. Most of it is fairly straightforward (it seems), but I've been looking for examples of reading PEM public and

Coverity failures on github

2022-02-03 Thread Philip Prindeville
I'm getting daily reports about static analysis failures: https://github.com/pprindeville/openssl/runs/5060866030?check_suite_focus=true Which says: Run wget https://scan.coverity.com/download/linux64 \ wget https://scan.coverity.com/download/linux64 \ --post-data

Bad exit code with pkeyutl -verify in 1.0.2f

2022-05-14 Thread Philip Prindeville
I know this is an ancient version, but I was wondering if this was a known bug so I could figure out which release it was fixed in, as I have to disable the check for the exit status in my regression tests: [philipp@centos7 asterisk]$ openssl version OpenSSL 1.0.2k-fips 26 Jan 2017

Re: AES and EVP_CIPHER question

2022-05-16 Thread Philip Prindeville
Sorry, I shouldn't have phrased that inartfully. There is no EVP_CIPHER_CTX_get_padding(), so how does one achieve something analogous? > On May 16, 2022, at 1:00 PM, Philip Prindeville > wrote: > > Thanks. That fixed the return value of EVP_CipherFinal(). > > Is

Re: AES and EVP_CIPHER question

2022-05-17 Thread Philip Prindeville
> On May 17, 2022, at 4:32 AM, Matt Caswell wrote: > > > > On 16/05/2022 23:48, Philip Prindeville wrote: >> Sorry, I shouldn't have phrased that inartfully. >> There is no EVP_CIPHER_CTX_get_padding(), so how does one achieve something >> analogou

Re: Compiling OpenSSL using a different SDK

2022-05-13 Thread Philip Prindeville
Openssl already supports cross-compiles, since OpenWRT and Yocto/OpenEmbedded use it as-is. https://github.com/openwrt/openwrt/blob/master/package/libs/openssl/Makefile#L328..L357 > On May 6, 2022, at 6:25 AM, ~ Kunal Sharma ~ wrote: > > Hi friends, > > My objective is to compile OpenSSL

Re: AES and EVP_CIPHER question

2022-05-13 Thread Philip Prindeville
> On May 13, 2022, at 10:34 AM, Matt Caswell wrote: > > > > On 13/05/2022 16:49, Philip Prindeville wrote: >> Hi, >> I'm trying to rewrite some legacy AES_* code to use EVP_CIPHER_* so it's >> forward compatible into 3.x. >> My code, i

Re: AES and EVP_CIPHER question

2022-05-13 Thread Philip Prindeville
Here's a simple/stupid test program and its output, running on Ubuntu 20.04 LTS: OpenSSL 1.1.1f 31 Mar 2020 EVP_CIPHER_CTX_new returns 0x5627171042a0 EVP_CipherInit returns 1 EVP_CipherUpdate returns 1, outlen = 0 buf: 'Mary had a littl' EVP_CipherFinal returns 0, finallen = 0 buf: 'Mary had a

Re: AES and EVP_CIPHER question

2022-05-13 Thread Philip Prindeville
> On May 13, 2022, at 10:55 AM, Philip Prindeville > wrote: > > > >> On May 13, 2022, at 10:34 AM, Matt Caswell wrote: >> >> >> >> On 13/05/2022 16:49, Philip Prindeville wrote: >>> Hi, >>> I'm trying to rewrite some legacy

AES and EVP_CIPHER question

2022-05-13 Thread Philip Prindeville
Hi, I'm trying to rewrite some legacy AES_* code to use EVP_CIPHER_* so it's forward compatible into 3.x. My code, in a nutshell, looks like: static int evp_cipher_aes_decrypt(const unsigned char *in, unsigned char *out, unsigned inlen, const ast_aes_decrypt_key *key) { EVP_CIPHER_CTX

Re: AES and EVP_CIPHER question

2022-05-16 Thread Philip Prindeville
led after the > EVP_CipherInit() to have an effect. > > Also what is the AST_CRYPTO_AES_BLOCKSIZE value? Is it in bits (i.e, > 128)? > > Also res should be initialized to -1 so you do not return uninitialized > value on error. > > Tomas Mraz > > On Fri, 2022-05-1

Non-heap based structures

2022-07-26 Thread Philip Prindeville
Hi, I suspect I already know the answer, but... is there a way to have a non-heap based structure like EVP_MD_CTX? If I don't want to have one be malloc'd (or OPENSSL_zalloc'd as the case may be), I can't have one be a stack variable or static, can I? I ask because I'm trying to replace some

Re: [EXTERNAL] Using openssl-rsautl for verifying signatures.

2022-05-06 Thread Philip Prindeville
ith RSA_PKCS1_PADDING. > > Tomas > > On Thu, 2022-05-05 at 10:35 -0600, Philip Prindeville wrote: >> Bonjour. Et milles mercis. >> >> That was helpful. >> >> One more question: if I want to reproduce RSA_sign() (and >> RSA_verify()) using evp_key_s

RSA test vectors, etc.

2022-04-27 Thread Philip Prindeville
Hi, I've been trying to rewrite the res_crypto.so support in Asterisk to use Openssl-1.1.x and the EVP_PKEY interface, rather than the AES_* and RSA_* stuff. The AES stuff uses ECB and 128 bit keys... That's a larger issue of redesigning the entire API and the client apps to support GCM and

Re: RSA test vectors, etc.

2022-04-27 Thread Philip Prindeville
and 3.0? > On Apr 27, 2022, at 10:43 AM, Philip Prindeville > wrote: > > Hi, > > I've been trying to rewrite the res_crypto.so support in Asterisk to use > Openssl-1.1.x and the EVP_PKEY interface, rather than the AES_* and RSA_* > stuff. > > The AES stuff uses

Using openssl-rsautl for verifying signatures

2022-05-03 Thread Philip Prindeville
Hi, I did the following in trying to build some validation steps to use against my own rewrite of the crypto functions in Asterisk (to use EVP-PKEY). % echo -n "Mary had a little lamb." | openssl sha1 -binary > digest % od -t x1 digest 000 4e 07 b8 c7 aa f2 a4 ed 4c e3 9e 76 f6 5d 2a 04

Re: [EXTERNAL] Using openssl-rsautl for verifying signatures.

2022-05-05 Thread Philip Prindeville
Bonjour. Et milles mercis. That was helpful. One more question: if I want to reproduce RSA_sign() (and RSA_verify()) using evp_key_sign() and evp_key_verify() then I'll need add code to do the ASN.1 marshaling, right? There's no convenience function to do that (seems like an oversight if

Re: Best Practices for private key files handling

2022-09-17 Thread Philip Prindeville
> On Sep 15, 2022, at 4:27 PM, Michael Wojcik via openssl-users > wrote: > >> From: openssl-users On Behalf Of Philip >> Prindeville >> Sent: Thursday, 15 September, 2022 15:41 > >> I was thinking of the case where the directory containing the keys (

Best Practices for private key files handling

2022-09-13 Thread Philip Prindeville
Hi, I'm working on a bug in an application where the application config is given the directory path in which to find a key-store, which it then loads. My issue is this: a regular UNIX file is trivial to handle (make sure it's owned by "root" or the uid that the app runs at, and that it's 0600

Re: Best Practices for private key files handling

2022-09-15 Thread Philip Prindeville
> On Sep 13, 2022, at 8:10 PM, Shawn Heisey via openssl-users > wrote: > > On 9/13/22 14:17, Philip Prindeville wrote: >> But what happens when the file we encounter is a symlink? If the symlink is >> owned by root but the target isn't, or the target permissions