Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error: cryptknockd.c:470:17: error: storage size of ‘ctx’ isn’t known #1

Open
jingkang99 opened this issue Nov 9, 2020 · 2 comments

Comments

@jingkang99
Copy link

since ssl lib API changed, the source code need be fixed

https://stackoverflow.com/questions/55992010/openssl-error-storage-size-of-ctx-isn-t-known

gcc cryptknockd.c -o cryptknockd -lssl -lcrypto -lpcap

In file included from /usr/include/inttypes.h:25:0,
from /usr/include/openssl/e_os2.h:243,
from /usr/include/openssl/dh.h:16,
from cryptknockd.c:30:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

^~~~~~~
cryptknockd.c: In function ‘read_options’:
cryptknockd.c:422:7: warning: implicit declaration of function ‘getopt_long’; did you mean ‘getopt’? [-Wimplicit-function-declaration]
i = getopt_long(argc, argv, "i:s:d:", NULL, NULL);
^~~~~~~~~~~
getopt
cryptknockd.c: In function ‘decrypt_pass’:
cryptknockd.c:470:17: error: storage size of ‘ctx’ isn’t known
EVP_CIPHER_CTX ctx;
^~~
cryptknockd.c: In function ‘dh_receive_packet’:
cryptknockd.c:674:16: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
BN_hex2bn(&(dh->g), g);

@Jiab77
Copy link
Owner

Jiab77 commented Jan 17, 2021

@jingkang99, thanks a lot for your issue. Do you have any ideas what lines needs to be changed to fix it?

@Jiab77
Copy link
Owner

Jiab77 commented Jan 17, 2021

@jingkang99, I'm pretty bad in C and C++ programming as I'm still a beginner but apparently the fix needs to be applied in:

  • cryptknock.c - Method encrypt_password - Line 243
  • cryptknockd.c - Method decrypt_pass - Line 468

All other methods are not related to openssl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants