build openssh-8.2 sshkey.c:4625:27: error: dereferencing pointer to incomplete type BIO_read(bio, keybuf, bio->num_write); bio->num_write //Not found struct BIO cc -g -O0 -D_FORTIFY_SOURCE=2 -DDEBUG_KEXECDH -fno-builtin-memset -I. -I. -I/build/store/ssl//include -I/build/store/ssl/include -I/build/store/zlib/include -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -DSSHDIR=\"/etc/ssh\" -D_PATH_SSH_PROGRAM=\"/build/store/newssh/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT=\"/build/store/newssh/libexec/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/build/store/newssh/libexec/sftp-server\" -D_PATH_SSH_KEY_SIGN=\"/build/store/newssh/libexec/ssh-keysign\" -D_PATH_SSH_PKCS11_HELPER=\"/build/store/newssh/libexec/ssh-pkcs11-helper\" -D_PATH_SSH_SK_HELPER=\"/build/store/newssh/libexec/ssh-sk-helper\" -D_PATH_SSH_PIDDIR=\"/run/\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DHAVE_CONFIG_H -c sshkey.c -o sshkey.o sshkey.c: In function ‘sshkey_parse_private_pem_fileblob’: sshkey.c:4625:27: error: dereferencing pointer to incomplete type BIO_read(bio, keybuf, bio->num_write); --- sshkey.c code view #include <openssl/err.h> #include <openssl/pem.h> #include <openssl/ossl_typ.h> .... static int sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, const char *passphrase, struct sshkey **keyp) { EVP_PKEY *pk = NULL; struct sshkey *prv = NULL; BIO *bio = NULL; int r; if (keyp != NULL) *keyp = NULL; if ((bio = BIO_new(BIO_s_mem())) == NULL || sshbuf_len(blob) > INT_MAX) return SSH_ERR_ALLOC_FAIL; if (BIO_write(bio, sshbuf_ptr(blob), sshbuf_len(blob)) != (int)sshbuf_len(blob)) { r = SSH_ERR_ALLOC_FAIL; goto out; } char keybuf[T_L_4] = {0}; BIO_read(bio, keybuf, bio->num_write);
from openssl include inmport error
build ok!
What platform, compiler is this, and in particular what configure options and CFLAGS did you give? I see at least one non-standard compiler flag. A quick test with openssh-8.2p1 and openssl-1.1.1d here compiles OK: $ CFLAGS="-g -O0 -D_FORTIFY_SOURCE=2 -DDEBUG_KEXECDH" ./configure --with-ssl-dir=/opt/openssl/1.1.1d && make clean && make [...] $ ./ssh -V OpenSSH_8.2p1, OpenSSL 1.1.1d 10 Sep 2019 $ ./configure --with-ssl-dir=/opt/openssl/1.1.1d --with-cflags=-DDEBUG_KEXECDH && make clean && make [...] $./ssh -V OpenSSH_8.2p1, OpenSSL 1.1.1d 10 Sep 2019 (I also renamed my system openssl include dir, which didn't make a difference). Is it possible it's picking up includes from a different version of OpenSSL somewhere in the search path? > sshkey.c: In function ‘sshkey_parse_private_pem_fileblob’: > sshkey.c:4625:27: error: dereferencing pointer to incomplete type > BIO_read(bio, keybuf, bio->num_write); wait, OpenSSH 8.2p1 doesn't even contain that line of code. $ curl -s https://raw.githubusercontent.com/openssh/openssh-portable/V_8_2/sshkey.c | grep num_write $ what modifications have you made to the code?
yes edit openssl-compat.c ... #include "internal/bio_lcl.h" ....
(In reply to cun from comment #4) > yes > > edit openssl-compat.c > ... > #include "internal/bio_lcl.h" > .... that can't be the only change since the line you're reporting errors on does not exist in the source code that the OpenSSH team ships. AFAICT the code as shipped by us compiles just fine with OpenSSL 1.1.1d.
(In reply to cun from comment #0) > sshkey.c: In function ‘sshkey_parse_private_pem_fileblob’: > sshkey.c:4625:27: error: dereferencing pointer to incomplete type > BIO_read(bio, keybuf, bio->num_write); In the sshkey.c shipped with OpenSSH 8.2p1, sshkey_parse_private_pem_fileblob() runs from line 4503 to 4602 and the code block immediately before the error ends at line 4522. This means you have added at least 100 lines of code to this file not including the one with the error. If you change the code and it doesn't work that's something you need to fix yourself.
closing resolved bugs as of 8.6p1 release