ios - SecKeyGetBlockSize(persistPeer); causes bad access -
seckeygetblocksize(persistpeer); causes bad access. have not worked before im not sure cause error.
nsdata* peertag = [@"test publickey" datausingencoding:nsutf8stringencoding]; nsdictionary * peerpublickeyattr = [nsdictionary dictionarywithobjectsandkeys: (__bridge id)ksecclasskey, ksecclass, (__bridge id)ksecattrkeytypersa, ksecattrkeytype, (__bridge id)ksecattrkeyclasspublic, ksecattrkeyclass, peertag, ksecattrapplicationtag, testpubkey, ksecvaluedata, kcfbooleantrue, ksecreturnpersistentref, nil]; osstatus sanitycheck = noerr; sanitycheck = secitemdelete((__bridge cfdictionaryref) peerpublickeyattr); seckeyref persistpeer = null; sanitycheck = secitemadd((__bridge cfdictionaryref)peerpublickeyattr, (cftyperef *)&persistpeer); nsdata* passworddata = [@"password" datausingencoding:nsutf8stringencoding]; nsdata* encryptedpass = [[methods sharedcenter]encrypt:passworddata usingkey:persistpeer]; size_t cipherbuffersize = seckeygetblocksize(persistpeer);
Comments
Post a Comment