Source Code/My Patch

[OpenSSL3 ] CMP_MSG body ๊ฐ’ ๊ฐ€์ ธ์˜ค๊ธฐ

JayKim๐Ÿ™‚ 2019. 12. 6. 15:12

CMP ๋ฉ”์„ธ์ง€์˜ Body๊ฐ’์„ ๊ฐ€์ ธ์˜ค๋Š” ํ•จ์ˆ˜์ด๋‹ค.

cmp.h.in ํŒŒ์ผ์— ์•„๋ž˜ ํ—ค๋”๋ฅผ ์ถ”๊ฐ€ ํ•˜๋ฉด cmp.h ํ—ค๋”์— ์ž๋™ ์ ์šฉ์ด ๋œ๋‹ค.

void* OSSL_CMP_MSG_get0_body( const OSSL_CMP_MSG *msg );

์ถ”๊ฐ€

 

cmp_msg.c  ํŒŒ์ผ์— ์•„๋ž˜ ํ•จ์ˆ˜ ์ถ”๊ฐ€

void* OSSL_CMP_MSG_get0_body( const OSSL_CMP_MSG *msg )
{
	if( msg == NULL || msg->body == NULL ) return NULL;

	switch ( msg->body->type ) {
		case OSSL_CMP_PKIBODY_IR:
		case OSSL_CMP_PKIBODY_CR:
		case OSSL_CMP_PKIBODY_KUR:
			return msg->body->value.ir;

		case OSSL_CMP_PKIBODY_P10CR:
			return msg->body->value.p10cr;

		case OSSL_CMP_PKIBODY_IP:
		case OSSL_CMP_PKIBODY_CP:
		case OSSL_CMP_PKIBODY_KUP:
			return msg->body->value.ip;

		case OSSL_CMP_PKIBODY_RR:
			return msg->body->value.rr;

		case OSSL_CMP_PKIBODY_RP:
			return msg->body->value.rp;

		case OSSL_CMP_PKIBODY_CERTCONF:
			return msg->body->value.certConf;

		case OSSL_CMP_PKIBODY_PKICONF:
			return msg->body->value.pkiconf;

		case OSSL_CMP_PKIBODY_POLLREQ:
			return msg->body->value.pollReq;

		case OSSL_CMP_PKIBODY_POLLREP:
			return msg->body->value.pollRep;

		case OSSL_CMP_PKIBODY_GENM:
		case OSSL_CMP_PKIBODY_GENP:
			return msg->body->value.genm;

		case OSSL_CMP_PKIBODY_ERROR:
			return msg->body->value.error;
	}

	return NULL;
}

์œˆ๋„์šฐ ์ง€์›์„ ์œ„ํ•ด์„œ๋Š”

utils/libcrypto.num ์— ๋‹ค์Œ ๊ฐ’์„ ์ฃผ์–ด์•ผ ํ•œ๋‹ค.

 

OSSL_CMP_MSG_get0_body                  5573    3_0_0   EXIST::FUNCTION:CMP