Deleted Added
full compact
pmeth_lib.c (325335) pmeth_lib.c (325337)
1/* pmeth_lib.c */
2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
4 * 2006.
5 */
6/* ====================================================================
7 * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
8 *

--- 575 unchanged lines hidden (view full) ---

584 void *p2),
585 int (*ctrl_str) (EVP_PKEY_CTX *ctx,
586 const char *type,
587 const char *value))
588{
589 pmeth->ctrl = ctrl;
590 pmeth->ctrl_str = ctrl_str;
591}
1/* pmeth_lib.c */
2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
4 * 2006.
5 */
6/* ====================================================================
7 * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
8 *

--- 575 unchanged lines hidden (view full) ---

584 void *p2),
585 int (*ctrl_str) (EVP_PKEY_CTX *ctx,
586 const char *type,
587 const char *value))
588{
589 pmeth->ctrl = ctrl;
590 pmeth->ctrl_str = ctrl_str;
591}
592
593void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth,
594 int (**pinit) (EVP_PKEY_CTX *ctx))
595{
596 *pinit = pmeth->init;
597}
598
599void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth,
600 int (**pcopy) (EVP_PKEY_CTX *dst,
601 EVP_PKEY_CTX *src))
602{
603 *pcopy = pmeth->copy;
604}
605
606void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth,
607 void (**pcleanup) (EVP_PKEY_CTX *ctx))
608{
609 *pcleanup = pmeth->cleanup;
610}
611
612void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth,
613 int (**pparamgen_init) (EVP_PKEY_CTX *ctx),
614 int (**pparamgen) (EVP_PKEY_CTX *ctx,
615 EVP_PKEY *pkey))
616{
617 if (pparamgen_init)
618 *pparamgen_init = pmeth->paramgen_init;
619 if (pparamgen)
620 *pparamgen = pmeth->paramgen;
621}
622
623void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth,
624 int (**pkeygen_init) (EVP_PKEY_CTX *ctx),
625 int (**pkeygen) (EVP_PKEY_CTX *ctx,
626 EVP_PKEY *pkey))
627{
628 if (pkeygen_init)
629 *pkeygen_init = pmeth->keygen_init;
630 if (pkeygen)
631 *pkeygen = pmeth->keygen;
632}
633
634void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth,
635 int (**psign_init) (EVP_PKEY_CTX *ctx),
636 int (**psign) (EVP_PKEY_CTX *ctx,
637 unsigned char *sig, size_t *siglen,
638 const unsigned char *tbs,
639 size_t tbslen))
640{
641 if (psign_init)
642 *psign_init = pmeth->sign_init;
643 if (psign)
644 *psign = pmeth->sign;
645}
646
647void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth,
648 int (**pverify_init) (EVP_PKEY_CTX *ctx),
649 int (**pverify) (EVP_PKEY_CTX *ctx,
650 const unsigned char *sig,
651 size_t siglen,
652 const unsigned char *tbs,
653 size_t tbslen))
654{
655 if (pverify_init)
656 *pverify_init = pmeth->verify_init;
657 if (pverify)
658 *pverify = pmeth->verify;
659}
660
661void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth,
662 int (**pverify_recover_init) (EVP_PKEY_CTX
663 *ctx),
664 int (**pverify_recover) (EVP_PKEY_CTX
665 *ctx,
666 unsigned char
667 *sig,
668 size_t *siglen,
669 const unsigned
670 char *tbs,
671 size_t tbslen))
672{
673 if (pverify_recover_init)
674 *pverify_recover_init = pmeth->verify_recover_init;
675 if (pverify_recover)
676 *pverify_recover = pmeth->verify_recover;
677}
678
679void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth,
680 int (**psignctx_init) (EVP_PKEY_CTX *ctx,
681 EVP_MD_CTX *mctx),
682 int (**psignctx) (EVP_PKEY_CTX *ctx,
683 unsigned char *sig,
684 size_t *siglen,
685 EVP_MD_CTX *mctx))
686{
687 if (psignctx_init)
688 *psignctx_init = pmeth->signctx_init;
689 if (psignctx)
690 *psignctx = pmeth->signctx;
691}
692
693void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth,
694 int (**pverifyctx_init) (EVP_PKEY_CTX *ctx,
695 EVP_MD_CTX *mctx),
696 int (**pverifyctx) (EVP_PKEY_CTX *ctx,
697 const unsigned char *sig,
698 int siglen,
699 EVP_MD_CTX *mctx))
700{
701 if (pverifyctx_init)
702 *pverifyctx_init = pmeth->verifyctx_init;
703 if (pverifyctx)
704 *pverifyctx = pmeth->verifyctx;
705}
706
707void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth,
708 int (**pencrypt_init) (EVP_PKEY_CTX *ctx),
709 int (**pencryptfn) (EVP_PKEY_CTX *ctx,
710 unsigned char *out,
711 size_t *outlen,
712 const unsigned char *in,
713 size_t inlen))
714{
715 if (pencrypt_init)
716 *pencrypt_init = pmeth->encrypt_init;
717 if (pencryptfn)
718 *pencryptfn = pmeth->encrypt;
719}
720
721void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth,
722 int (**pdecrypt_init) (EVP_PKEY_CTX *ctx),
723 int (**pdecrypt) (EVP_PKEY_CTX *ctx,
724 unsigned char *out,
725 size_t *outlen,
726 const unsigned char *in,
727 size_t inlen))
728{
729 if (pdecrypt_init)
730 *pdecrypt_init = pmeth->decrypt_init;
731 if (pdecrypt)
732 *pdecrypt = pmeth->decrypt;
733}
734
735void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth,
736 int (**pderive_init) (EVP_PKEY_CTX *ctx),
737 int (**pderive) (EVP_PKEY_CTX *ctx,
738 unsigned char *key,
739 size_t *keylen))
740{
741 if (pderive_init)
742 *pderive_init = pmeth->derive_init;
743 if (pderive)
744 *pderive = pmeth->derive;
745}
746
747void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth,
748 int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
749 void *p2),
750 int (**pctrl_str) (EVP_PKEY_CTX *ctx,
751 const char *type,
752 const char *value))
753{
754 if (pctrl)
755 *pctrl = pmeth->ctrl;
756 if (pctrl_str)
757 *pctrl_str = pmeth->ctrl_str;
758}