Skip to content

Instantly share code, notes, and snippets.

@mridulbirla
Created November 9, 2016 18:36
Show Gist options
  • Save mridulbirla/b74734546f8571a7077b7b254507fcc9 to your computer and use it in GitHub Desktop.
Save mridulbirla/b74734546f8571a7077b7b254507fcc9 to your computer and use it in GitHub Desktop.
Luacrypto error
[mbirla@r-003]$ luarocks install luacrypto OPENSSL_INCDIR='/N/u/mbirla/ssl/include'
Installing https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luacrypto-0.3.2-2.src.rock...
Using https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luacrypto-0.3.2-2.src.rock... switching to 'build' mode
gcc -O2 -fPIC -I/N/u/mbirla/torch/install/include -c src/lcrypto.c -o src/lcrypto.o -I/N/u/mbirla/ssl/include
src/lcrypto.c: In function ‘digest_pnew’:
src/lcrypto.c:81:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’
EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
^
src/lcrypto.c: In function ‘encrypt_pnew’:
src/lcrypto.c:331:69: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’
EVP_CIPHER_CTX *c = (EVP_CIPHER_CTX *)lua_newuserdata(L, sizeof(EVP_CIPHER_CTX));
^
src/lcrypto.c: In function ‘encrypt_fencrypt’:
src/lcrypto.c:425:20: error: storage size of ‘c’ isn’t known
EVP_CIPHER_CTX c;
^
src/lcrypto.c: In function ‘decrypt_pnew’:
src/lcrypto.c:470:69: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’
EVP_CIPHER_CTX *c = (EVP_CIPHER_CTX *)lua_newuserdata(L, sizeof(EVP_CIPHER_CTX));
^
src/lcrypto.c: In function ‘decrypt_fdecrypt’:
src/lcrypto.c:561:20: error: storage size of ‘c’ isn’t known
EVP_CIPHER_CTX c;
^
src/lcrypto.c: In function ‘hmac_pnew’:
src/lcrypto.c:604:57: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’
HMAC_CTX *c = (HMAC_CTX *)lua_newuserdata(L, sizeof(HMAC_CTX));
^
src/lcrypto.c: In function ‘hmac_clone’:
src/lcrypto.c:631:5: error: dereferencing pointer to incomplete type
*d = *c;
^
src/lcrypto.c:631:10: error: dereferencing pointer to incomplete type
*d = *c;
^
src/lcrypto.c: In function ‘hmac_fdigest’:
src/lcrypto.c:711:14: error: storage size of ‘c’ isn’t known
HMAC_CTX c;
^
src/lcrypto.c: In function ‘sign_pnew’:
src/lcrypto.c:747:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’
EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
^
src/lcrypto.c: In function ‘sign_fsign’:
src/lcrypto.c:828:20: error: storage size of ‘c’ isn’t known
EVP_MD_CTX c;
^
src/lcrypto.c: In function ‘verify_pnew’:
src/lcrypto.c:857:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’
EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
^
src/lcrypto.c: In function ‘verify_fverify’:
src/lcrypto.c:940:20: error: storage size of ‘c’ isn’t known
EVP_MD_CTX c;
^
src/lcrypto.c: In function ‘rand_pseudo_bytes’:
src/lcrypto.c:992:5: warning: ‘RAND_pseudo_bytes’ is deprecated (declared at /N/u/mbirla/ssl/include/openssl/rand.h:47) [-Wdeprecated-declarations]
return rand_do_bytes(L, RAND_pseudo_bytes);
^
src/lcrypto.c: In function ‘pkey_generate’:
src/lcrypto.c:1064:9: warning: ‘RSA_generate_key’ is deprecated (declared at /N/u/mbirla/ssl/include/openssl/rsa.h:193) [-Wdeprecated-declarations]
RSA *rsa = RSA_generate_key(key_len, RSA_F4, NULL, NULL);
^
src/lcrypto.c:1074:9: warning: ‘DSA_generate_parameters’ is deprecated (declared at /N/u/mbirla/ssl/include/openssl/dsa.h:122) [-Wdeprecated-declarations]
DSA *dsa = DSA_generate_parameters(key_len, NULL, 0, NULL, NULL, NULL, NULL);
^
src/lcrypto.c: In function ‘pkey_to_pem’:
src/lcrypto.c:1164:27: error: dereferencing pointer to incomplete type
if (private && pkey_st->type == EVP_PKEY_DSA)
^
src/lcrypto.c:1165:55: error: dereferencing pointer to incomplete type
ret = PEM_write_bio_DSAPrivateKey(mem, pkey_st->pkey.dsa, NULL, NULL, 0, NULL, NULL);
^
src/lcrypto.c:1166:32: error: dereferencing pointer to incomplete type
else if (private && pkey_st->type == EVP_PKEY_RSA)
^
src/lcrypto.c:1167:55: error: dereferencing pointer to incomplete type
ret = PEM_write_bio_RSAPrivateKey(mem, pkey_st->pkey.rsa, NULL, NULL, 0, NULL, NULL);
^
src/lcrypto.c: In function ‘pkey_tostring’:
src/lcrypto.c:1277:60: error: dereferencing pointer to incomplete type
sprintf(buf, "%s %s %d %p", LUACRYPTO_PKEYNAME, (*pkey)->type == EVP_PKEY_DSA ? "DSA" : "RSA", EVP_PKEY_bits(*pkey), pkey);
^
src/lcrypto.c: In function ‘seal_pnew’:
src/lcrypto.c:1299:46: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’
c->ctx = (EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX));
^
In file included from src/lcrypto.c:8:0:
src/lcrypto.c: In function ‘seal_tostring’:
src/lcrypto.c:1320:81: error: dereferencing pointer to incomplete type
sprintf(s, "%s %p %s", LUACRYPTO_SEALNAME, (void *)c, EVP_CIPHER_name(c->ctx->cipher));
^
/N/u/mbirla/ssl/include/openssl/evp.h:427:68: note: in definition of macro ‘EVP_CIPHER_name’
# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
^
src/lcrypto.c: In function ‘seal_final’:
src/lcrypto.c:1379:80: error: dereferencing pointer to incomplete type
lua_pushlstring(L, (const char *)c->iv, (size_t)EVP_CIPHER_iv_length(c->ctx->cipher));
^
src/lcrypto.c: In function ‘seal_fseal’:
src/lcrypto.c:1400:20: error: storage size of ‘ctx’ isn’t known
EVP_CIPHER_CTX ctx;
^
src/lcrypto.c: In function ‘open_pnew’:
src/lcrypto.c:1483:46: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’
c->ctx = (EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX));
^
src/lcrypto.c: In function ‘open_tostring’:
src/lcrypto.c:1509:20: error: dereferencing pointer to incomplete type
(*pkey)->type == EVP_PKEY_DSA ? "DSA" : "RSA", EVP_PKEY_bits(*pkey), pkey);
^
src/lcrypto.c: In function ‘open_fopen’:
src/lcrypto.c:1602:20: error: storage size of ‘ctx’ isn’t known
EVP_CIPHER_CTX ctx;
^
Error: Build error: Failed compiling object src/lcrypto.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment