evp.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. #include <contrib/libs/openssl/redef.h>
  2. /*
  3. * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
  4. *
  5. * Licensed under the OpenSSL license (the "License"). You may not use
  6. * this file except in compliance with the License. You can obtain a copy
  7. * in the file LICENSE in the source distribution or at
  8. * https://www.openssl.org/source/license.html
  9. */
  10. #include <openssl/evp.h>
  11. #include "internal/refcount.h"
  12. /*
  13. * Don't free up md_ctx->pctx in EVP_MD_CTX_reset, use the reserved flag
  14. * values in evp.h
  15. */
  16. #define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX 0x0400
  17. struct evp_pkey_ctx_st {
  18. /* Method associated with this operation */
  19. const EVP_PKEY_METHOD *pmeth;
  20. /* Engine that implements this method or NULL if builtin */
  21. ENGINE *engine;
  22. /* Key: may be NULL */
  23. EVP_PKEY *pkey;
  24. /* Peer key for key agreement, may be NULL */
  25. EVP_PKEY *peerkey;
  26. /* Actual operation */
  27. int operation;
  28. /* Algorithm specific data */
  29. void *data;
  30. /* Application specific data */
  31. void *app_data;
  32. /* Keygen callback */
  33. EVP_PKEY_gen_cb *pkey_gencb;
  34. /* implementation specific keygen data */
  35. int *keygen_info;
  36. int keygen_info_count;
  37. } /* EVP_PKEY_CTX */ ;
  38. #define EVP_PKEY_FLAG_DYNAMIC 1
  39. struct evp_pkey_method_st {
  40. int pkey_id;
  41. int flags;
  42. int (*init) (EVP_PKEY_CTX *ctx);
  43. int (*copy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src);
  44. void (*cleanup) (EVP_PKEY_CTX *ctx);
  45. int (*paramgen_init) (EVP_PKEY_CTX *ctx);
  46. int (*paramgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
  47. int (*keygen_init) (EVP_PKEY_CTX *ctx);
  48. int (*keygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
  49. int (*sign_init) (EVP_PKEY_CTX *ctx);
  50. int (*sign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
  51. const unsigned char *tbs, size_t tbslen);
  52. int (*verify_init) (EVP_PKEY_CTX *ctx);
  53. int (*verify) (EVP_PKEY_CTX *ctx,
  54. const unsigned char *sig, size_t siglen,
  55. const unsigned char *tbs, size_t tbslen);
  56. int (*verify_recover_init) (EVP_PKEY_CTX *ctx);
  57. int (*verify_recover) (EVP_PKEY_CTX *ctx,
  58. unsigned char *rout, size_t *routlen,
  59. const unsigned char *sig, size_t siglen);
  60. int (*signctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
  61. int (*signctx) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
  62. EVP_MD_CTX *mctx);
  63. int (*verifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
  64. int (*verifyctx) (EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen,
  65. EVP_MD_CTX *mctx);
  66. int (*encrypt_init) (EVP_PKEY_CTX *ctx);
  67. int (*encrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
  68. const unsigned char *in, size_t inlen);
  69. int (*decrypt_init) (EVP_PKEY_CTX *ctx);
  70. int (*decrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
  71. const unsigned char *in, size_t inlen);
  72. int (*derive_init) (EVP_PKEY_CTX *ctx);
  73. int (*derive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
  74. int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
  75. int (*ctrl_str) (EVP_PKEY_CTX *ctx, const char *type, const char *value);
  76. int (*digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
  77. const unsigned char *tbs, size_t tbslen);
  78. int (*digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig,
  79. size_t siglen, const unsigned char *tbs,
  80. size_t tbslen);
  81. int (*check) (EVP_PKEY *pkey);
  82. int (*public_check) (EVP_PKEY *pkey);
  83. int (*param_check) (EVP_PKEY *pkey);
  84. int (*digest_custom) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
  85. } /* EVP_PKEY_METHOD */ ;
  86. DEFINE_STACK_OF_CONST(EVP_PKEY_METHOD)
  87. void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx);
  88. extern const EVP_PKEY_METHOD cmac_pkey_meth;
  89. extern const EVP_PKEY_METHOD dh_pkey_meth;
  90. extern const EVP_PKEY_METHOD dhx_pkey_meth;
  91. extern const EVP_PKEY_METHOD dsa_pkey_meth;
  92. extern const EVP_PKEY_METHOD ec_pkey_meth;
  93. extern const EVP_PKEY_METHOD sm2_pkey_meth;
  94. extern const EVP_PKEY_METHOD ecx25519_pkey_meth;
  95. extern const EVP_PKEY_METHOD ecx448_pkey_meth;
  96. extern const EVP_PKEY_METHOD ed25519_pkey_meth;
  97. extern const EVP_PKEY_METHOD ed448_pkey_meth;
  98. extern const EVP_PKEY_METHOD hmac_pkey_meth;
  99. extern const EVP_PKEY_METHOD rsa_pkey_meth;
  100. extern const EVP_PKEY_METHOD rsa_pss_pkey_meth;
  101. extern const EVP_PKEY_METHOD scrypt_pkey_meth;
  102. extern const EVP_PKEY_METHOD tls1_prf_pkey_meth;
  103. extern const EVP_PKEY_METHOD hkdf_pkey_meth;
  104. extern const EVP_PKEY_METHOD poly1305_pkey_meth;
  105. extern const EVP_PKEY_METHOD siphash_pkey_meth;
  106. struct evp_md_st {
  107. int type;
  108. int pkey_type;
  109. int md_size;
  110. unsigned long flags;
  111. int (*init) (EVP_MD_CTX *ctx);
  112. int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
  113. int (*final) (EVP_MD_CTX *ctx, unsigned char *md);
  114. int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);
  115. int (*cleanup) (EVP_MD_CTX *ctx);
  116. int block_size;
  117. int ctx_size; /* how big does the ctx->md_data need to be */
  118. /* control function */
  119. int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
  120. } /* EVP_MD */ ;
  121. struct evp_cipher_st {
  122. int nid;
  123. int block_size;
  124. /* Default value for variable length ciphers */
  125. int key_len;
  126. int iv_len;
  127. /* Various flags */
  128. unsigned long flags;
  129. /* init key */
  130. int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key,
  131. const unsigned char *iv, int enc);
  132. /* encrypt/decrypt data */
  133. int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out,
  134. const unsigned char *in, size_t inl);
  135. /* cleanup ctx */
  136. int (*cleanup) (EVP_CIPHER_CTX *);
  137. /* how big ctx->cipher_data needs to be */
  138. int ctx_size;
  139. /* Populate a ASN1_TYPE with parameters */
  140. int (*set_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
  141. /* Get parameters from a ASN1_TYPE */
  142. int (*get_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
  143. /* Miscellaneous operations */
  144. int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr);
  145. /* Application data */
  146. void *app_data;
  147. } /* EVP_CIPHER */ ;
  148. /* Macros to code block cipher wrappers */
  149. /* Wrapper functions for each cipher mode */
  150. #define EVP_C_DATA(kstruct, ctx) \
  151. ((kstruct *)EVP_CIPHER_CTX_get_cipher_data(ctx))
  152. #define BLOCK_CIPHER_ecb_loop() \
  153. size_t i, bl; \
  154. bl = EVP_CIPHER_CTX_cipher(ctx)->block_size; \
  155. if (inl < bl) return 1;\
  156. inl -= bl; \
  157. for (i=0; i <= inl; i+=bl)
  158. #define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
  159. static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
  160. {\
  161. BLOCK_CIPHER_ecb_loop() \
  162. cprefix##_ecb_encrypt(in + i, out + i, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_encrypting(ctx)); \
  163. return 1;\
  164. }
  165. #define EVP_MAXCHUNK ((size_t)1<<(sizeof(long)*8-2))
  166. #define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) \
  167. static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
  168. {\
  169. while(inl>=EVP_MAXCHUNK) {\
  170. int num = EVP_CIPHER_CTX_num(ctx);\
  171. cprefix##_ofb##cbits##_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx), &num); \
  172. EVP_CIPHER_CTX_set_num(ctx, num);\
  173. inl-=EVP_MAXCHUNK;\
  174. in +=EVP_MAXCHUNK;\
  175. out+=EVP_MAXCHUNK;\
  176. }\
  177. if (inl) {\
  178. int num = EVP_CIPHER_CTX_num(ctx);\
  179. cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx), &num); \
  180. EVP_CIPHER_CTX_set_num(ctx, num);\
  181. }\
  182. return 1;\
  183. }
  184. #define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
  185. static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
  186. {\
  187. while(inl>=EVP_MAXCHUNK) \
  188. {\
  189. cprefix##_cbc_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx));\
  190. inl-=EVP_MAXCHUNK;\
  191. in +=EVP_MAXCHUNK;\
  192. out+=EVP_MAXCHUNK;\
  193. }\
  194. if (inl)\
  195. cprefix##_cbc_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx));\
  196. return 1;\
  197. }
  198. #define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
  199. static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
  200. {\
  201. size_t chunk = EVP_MAXCHUNK;\
  202. if (cbits == 1) chunk >>= 3;\
  203. if (inl < chunk) chunk = inl;\
  204. while (inl && inl >= chunk)\
  205. {\
  206. int num = EVP_CIPHER_CTX_num(ctx);\
  207. cprefix##_cfb##cbits##_encrypt(in, out, (long) \
  208. ((cbits == 1) \
  209. && !EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS) \
  210. ? chunk*8 : chunk), \
  211. &EVP_C_DATA(kstruct, ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx),\
  212. &num, EVP_CIPHER_CTX_encrypting(ctx));\
  213. EVP_CIPHER_CTX_set_num(ctx, num);\
  214. inl -= chunk;\
  215. in += chunk;\
  216. out += chunk;\
  217. if (inl < chunk) chunk = inl;\
  218. }\
  219. return 1;\
  220. }
  221. #define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
  222. BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
  223. BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
  224. BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
  225. BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched)
  226. #define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, \
  227. key_len, iv_len, flags, init_key, cleanup, \
  228. set_asn1, get_asn1, ctrl) \
  229. static const EVP_CIPHER cname##_##mode = { \
  230. nid##_##nmode, block_size, key_len, iv_len, \
  231. flags | EVP_CIPH_##MODE##_MODE, \
  232. init_key, \
  233. cname##_##mode##_cipher, \
  234. cleanup, \
  235. sizeof(kstruct), \
  236. set_asn1, get_asn1,\
  237. ctrl, \
  238. NULL \
  239. }; \
  240. const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
  241. #define BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, \
  242. iv_len, flags, init_key, cleanup, set_asn1, \
  243. get_asn1, ctrl) \
  244. BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \
  245. iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
  246. #define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, \
  247. iv_len, cbits, flags, init_key, cleanup, \
  248. set_asn1, get_asn1, ctrl) \
  249. BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, 1, \
  250. key_len, iv_len, flags, init_key, cleanup, set_asn1, \
  251. get_asn1, ctrl)
  252. #define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, \
  253. iv_len, cbits, flags, init_key, cleanup, \
  254. set_asn1, get_asn1, ctrl) \
  255. BLOCK_CIPHER_def1(cname, ofb##cbits, ofb, OFB, kstruct, nid, 1, \
  256. key_len, iv_len, flags, init_key, cleanup, set_asn1, \
  257. get_asn1, ctrl)
  258. #define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, \
  259. flags, init_key, cleanup, set_asn1, \
  260. get_asn1, ctrl) \
  261. BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \
  262. 0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
  263. #define BLOCK_CIPHER_defs(cname, kstruct, \
  264. nid, block_size, key_len, iv_len, cbits, flags, \
  265. init_key, cleanup, set_asn1, get_asn1, ctrl) \
  266. BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
  267. init_key, cleanup, set_asn1, get_asn1, ctrl) \
  268. BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \
  269. flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
  270. BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \
  271. flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
  272. BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \
  273. init_key, cleanup, set_asn1, get_asn1, ctrl)
  274. /*-
  275. #define BLOCK_CIPHER_defs(cname, kstruct, \
  276. nid, block_size, key_len, iv_len, flags,\
  277. init_key, cleanup, set_asn1, get_asn1, ctrl)\
  278. static const EVP_CIPHER cname##_cbc = {\
  279. nid##_cbc, block_size, key_len, iv_len, \
  280. flags | EVP_CIPH_CBC_MODE,\
  281. init_key,\
  282. cname##_cbc_cipher,\
  283. cleanup,\
  284. sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
  285. sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
  286. set_asn1, get_asn1,\
  287. ctrl, \
  288. NULL \
  289. };\
  290. const EVP_CIPHER *EVP_##cname##_cbc(void) { return &cname##_cbc; }\
  291. static const EVP_CIPHER cname##_cfb = {\
  292. nid##_cfb64, 1, key_len, iv_len, \
  293. flags | EVP_CIPH_CFB_MODE,\
  294. init_key,\
  295. cname##_cfb_cipher,\
  296. cleanup,\
  297. sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
  298. sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
  299. set_asn1, get_asn1,\
  300. ctrl,\
  301. NULL \
  302. };\
  303. const EVP_CIPHER *EVP_##cname##_cfb(void) { return &cname##_cfb; }\
  304. static const EVP_CIPHER cname##_ofb = {\
  305. nid##_ofb64, 1, key_len, iv_len, \
  306. flags | EVP_CIPH_OFB_MODE,\
  307. init_key,\
  308. cname##_ofb_cipher,\
  309. cleanup,\
  310. sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
  311. sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
  312. set_asn1, get_asn1,\
  313. ctrl,\
  314. NULL \
  315. };\
  316. const EVP_CIPHER *EVP_##cname##_ofb(void) { return &cname##_ofb; }\
  317. static const EVP_CIPHER cname##_ecb = {\
  318. nid##_ecb, block_size, key_len, iv_len, \
  319. flags | EVP_CIPH_ECB_MODE,\
  320. init_key,\
  321. cname##_ecb_cipher,\
  322. cleanup,\
  323. sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
  324. sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
  325. set_asn1, get_asn1,\
  326. ctrl,\
  327. NULL \
  328. };\
  329. const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; }
  330. */
  331. #define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid, \
  332. block_size, key_len, iv_len, cbits, \
  333. flags, init_key, \
  334. cleanup, set_asn1, get_asn1, ctrl) \
  335. BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
  336. BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \
  337. cbits, flags, init_key, cleanup, set_asn1, \
  338. get_asn1, ctrl)
  339. #define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len,fl) \
  340. BLOCK_CIPHER_func_cfb(cipher##_##keysize,cprefix,cbits,kstruct,ksched) \
  341. BLOCK_CIPHER_def_cfb(cipher##_##keysize,kstruct, \
  342. NID_##cipher##_##keysize, keysize/8, iv_len, cbits, \
  343. (fl)|EVP_CIPH_FLAG_DEFAULT_ASN1, \
  344. cipher##_init_key, NULL, NULL, NULL, NULL)
  345. # ifndef OPENSSL_NO_EC
  346. #define X25519_KEYLEN 32
  347. #define X448_KEYLEN 56
  348. #define ED448_KEYLEN 57
  349. #define MAX_KEYLEN ED448_KEYLEN
  350. typedef struct {
  351. unsigned char pubkey[MAX_KEYLEN];
  352. unsigned char *privkey;
  353. } ECX_KEY;
  354. #endif
  355. /*
  356. * Type needs to be a bit field Sub-type needs to be for variations on the
  357. * method, as in, can it do arbitrary encryption....
  358. */
  359. struct evp_pkey_st {
  360. int type;
  361. int save_type;
  362. CRYPTO_REF_COUNT references;
  363. const EVP_PKEY_ASN1_METHOD *ameth;
  364. ENGINE *engine;
  365. ENGINE *pmeth_engine; /* If not NULL public key ENGINE to use */
  366. union {
  367. void *ptr;
  368. # ifndef OPENSSL_NO_RSA
  369. struct rsa_st *rsa; /* RSA */
  370. # endif
  371. # ifndef OPENSSL_NO_DSA
  372. struct dsa_st *dsa; /* DSA */
  373. # endif
  374. # ifndef OPENSSL_NO_DH
  375. struct dh_st *dh; /* DH */
  376. # endif
  377. # ifndef OPENSSL_NO_EC
  378. struct ec_key_st *ec; /* ECC */
  379. ECX_KEY *ecx; /* X25519, X448, Ed25519, Ed448 */
  380. # endif
  381. } pkey;
  382. int save_parameters;
  383. STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
  384. CRYPTO_RWLOCK *lock;
  385. } /* EVP_PKEY */ ;
  386. void openssl_add_all_ciphers_int(void);
  387. void openssl_add_all_digests_int(void);
  388. void evp_cleanup_int(void);
  389. void evp_app_cleanup_int(void);
  390. /* Pulling defines out of C source files */
  391. #define EVP_RC4_KEY_SIZE 16
  392. #ifndef TLS1_1_VERSION
  393. # define TLS1_1_VERSION 0x0302
  394. #endif
  395. void evp_encode_ctx_set_flags(EVP_ENCODE_CTX *ctx, unsigned int flags);
  396. /* EVP_ENCODE_CTX flags */
  397. /* Don't generate new lines when encoding */
  398. #define EVP_ENCODE_CTX_NO_NEWLINES 1
  399. /* Use the SRP base64 alphabet instead of the standard one */
  400. #define EVP_ENCODE_CTX_USE_SRP_ALPHABET 2