Source Code/My Patch

[CMPOSSL] OSSL_CMP_REVDETAILS ์‚ฌ์šฉ ์ง€์› ํ•˜๊ธฐ

JayKim๐Ÿ™‚ 2019. 12. 10. 14:43

cmp_int.h ์—์„œ

DEFINE_STACK_OF(OSSL_CMP_REVDETAILS)  <-- ์ด ๋ถ€๋ถ„ ์ฃผ์„ ์ฒ˜๋ฆฌ

 

cmp.h ์— ์•„๋ž˜ ๋‘ ์ค„ ์ถ”๊ฐ€ ํ•˜๊ธฐ

typedef struct OSSL_cmp_revdetails_st OSSL_CMP_REVDETAILS;
DEFINE_STACK_OF(OSSL_CMP_REVDETAILS)

 

cmp.h ๋‘ ํ•จ์ˆ˜ ์ถ”๊ฐ€

OSSL_CRMF_CERTTEMPLATE* OSSL_CMP_REVDETAILS_get0_certDetails( const OSSL_CMP_REVDETAILS *details );
X509_EXTENSIONS* OSSL_CMP_REVDETAILS_get0_crlEntryDetails( const OSSL_CMP_REVDETAILS *details );

cmp_lib.c ์— ํ•จ์ˆ˜ ์†Œ์Šค ์ถ”๊ฐ€

OSSL_CRMF_CERTTEMPLATE* OSSL_CMP_REVDETAILS_get0_certDetails( const OSSL_CMP_REVDETAILS *details )
{
	if( details == NULL ) return NULL;
	
    return details->certDetails;
}


X509_EXTENSIONS* OSSL_CMP_REVDETAILS_get0_crlEntryDetails( const OSSL_CMP_REVDETAILS *details )
{
	if( details == NULL ) return NULL;

	return details->crlEntryDetails;
}

 

์ฐธ๊ณ ) Openssl3 ์—์„œ๋Š” ์ ์šฉ์— ์–ด๋ ค์›€ ์žˆ์Œ( ์•„๋ž˜ ์ฒ˜๋ฆฌ ํ•จ )

cmp.h ์—

X509_EXTENSIONS* OSSL_CMP_get0_crlEntryDetails( void *pRR_Body, int index );
 
 
cmp_ctx.c ์—
 
X509_EXTENSIONS* OSSL_CMP_get0_crlEntryDetails( void *pRR_Body, int index )
{
    OSSL_CMP_REVDETAILS *pDetails = NULL;
    if( pRR_Body == NULL ) return NULL;

    STACK_OF(OSSL_CMP_REVDETAILS) *pRevDetails = pRR_Body;

    pDetails = sk_OSSL_CMP_REVDETAILS_value( pRevDetails, index );
    if( pDetails == NULL ) return NULL;

    return pDetails->crlEntryDetails;
}
 

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

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

 

OSSL_CMP_get0_crlEntryDetails                  5573    3_0_0   EXIST::FUNCTION:CMP

 

์†Œ์Šค ์ถ”๊ฐ€ ํ•จ.

์‹ค์ œ ํ•˜๋‚˜์˜ ํ•จ์ˆ˜ ๋งŒ ์‚ฌ์šฉํ•จ OSSL_CMP_REVDETAILS_get0_certDetails ๋Š” ํ•„์š” ์—†์Œ

index ๊ฐ’์€ 0 ๋ฒˆ์งธ๋กœ ์‚ฌ์šฉ

 

(Test ๋ถ€๋ถ„์— ์—๋Ÿฌ๊ฐ€ ๋‚˜์„œ Makefile ์—์„œ test_cmp_ctx ๊ด€๋ จ ์ œ๊ฑฐ ํ•จ)