亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3372 | 回復(fù): 2
打印 上一主題 下一主題

[函數(shù)] i2c_ASN1_BIT_STRING函數(shù)實現(xiàn)(openssl加了源代碼) [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2007-05-18 16:13 |只看該作者 |倒序瀏覽
各位有基于openssl開發(fā)的嗎?

這個函數(shù)的實現(xiàn)實在有點看不太明白。各位有了解這個函數(shù)的幫個忙給分析一下。

[ 本帖最后由 gooderfeng 于 2007-5-18 16:43 編輯 ]

論壇徽章:
0
2 [報告]
發(fā)表于 2007-05-18 16:32 |只看該作者
它是在a_bitstr.c中定義的,太詭異了函數(shù)實現(xiàn)。
函數(shù)實現(xiàn)如下
ASN1_STRING_FLAG_BITS_LEFT = ox08
int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
        {
        int ret,j,bits,len;
        unsigned char *p,*d;

        if (a == NULL) return(0);

        len=a->length;

        if (len > 0)
                {
                if (a->flags & ASN1_STRING_FLAG_BITS_LEFT)
                        {
                        bits=(int)a->flags&0x07;
                        }
                else
                        {
                        for ( ; len > 0; len--)
                                {
                                if (a->data[len-1]) break;
                                }
                        j=a->data[len-1];
                        if      (j & 0x01) bits=0;
                        else if (j & 0x02) bits=1;
                        else if (j & 0x04) bits=2;
                        else if (j & 0x0 bits=3;
                        else if (j & 0x10) bits=4;
                        else if (j & 0x20) bits=5;
                        else if (j & 0x40) bits=6;
                        else if (j & 0x80) bits=7;
                        else bits=0; /* should not happen */
                        }
                }
        else
                bits=0;

        ret=1+len;
        if (pp == NULL) return(ret);

        p= *pp;

        *(p++)=(unsigned char)bits;
        d=a->data;
        memcpy(p,d,len);
        p+=len;
        if (len > 0) p[-1]&=(0xff<<bits);
        *pp=p;
        return(ret);
        }

[ 本帖最后由 gooderfeng 于 2007-5-18 16:44 編輯 ]

論壇徽章:
0
3 [報告]
發(fā)表于 2007-05-18 16:44 |只看該作者
大家在看看這個代碼寫的怎么洋。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP