mirror of https://github.com/openssl/openssl.git
				
				
				
			New pkey functions for keygen callbacks and retrieving operation type.
This commit is contained in:
		
							parent
							
								
									21f0db692d
								
							
						
					
					
						commit
						b28dea4e10
					
				|  | @ -969,6 +969,9 @@ int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, | ||||||
| int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, | int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, | ||||||
| 						const char *value); | 						const char *value); | ||||||
| 
 | 
 | ||||||
|  | int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx); | ||||||
|  | void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); | ||||||
|  | 
 | ||||||
| void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); | void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); | ||||||
| void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx); | void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx); | ||||||
| EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); | EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); | ||||||
|  | @ -1009,6 +1012,8 @@ int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); | ||||||
| int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); | int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); | ||||||
| 
 | 
 | ||||||
| void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb); | void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb); | ||||||
|  | EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx); | ||||||
|  | 
 | ||||||
| int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx); | int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx); | ||||||
| 
 | 
 | ||||||
| void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, | void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, | ||||||
|  |  | ||||||
|  | @ -166,6 +166,11 @@ void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb) | ||||||
| 	ctx->pkey_gencb = cb; | 	ctx->pkey_gencb = cb; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx) | ||||||
|  | 	{ | ||||||
|  | 	return ctx->pkey_gencb; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| /* "translation callback" to call EVP_PKEY_CTX callbacks using BN_GENCB
 | /* "translation callback" to call EVP_PKEY_CTX callbacks using BN_GENCB
 | ||||||
|  * style callbacks. |  * style callbacks. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | @ -310,6 +310,17 @@ int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, | ||||||
| 	return ctx->pmeth->ctrl_str(ctx, name, value); | 	return ctx->pmeth->ctrl_str(ctx, name, value); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx) | ||||||
|  | 	{ | ||||||
|  | 	return ctx->operation; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen) | ||||||
|  | 	{ | ||||||
|  | 	ctx->keygen_info = dat; | ||||||
|  | 	ctx->keygen_info_count = datlen; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data) | void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data) | ||||||
| 	{ | 	{ | ||||||
| 	ctx->data = data; | 	ctx->data = data; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue