yourkarma / JWT

A JSON Web Token implementation in Objective-C.
MIT License
351 stars 107 forks source link

Fixes static analyser issue #175

Open valeriyvan opened 6 years ago

valeriyvan commented 6 years ago

New Pull Request Checklist

This merge request fixes / refers to the following issues: ...

Pull Request Description

...

lolgear commented 6 years ago

@valeriyvan

    OSStatus status = SecItemDelete((__bridge CFDictionaryRef)removeAttributes);
    if (status != errSecSuccess) {
        if (error) {
// incorrect. OSStatus is an error from different domain
            *error = [JWTErrorDescription errorWithCode:status];
        }
        return NO;
    }
valeriyvan commented 6 years ago

Makes sense. What would be correct way to create error here?

valeriyvan commented 6 years ago

Got it. It should be [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil]

lolgear commented 6 years ago

@valeriyvan could you check macOS tests? I suppose that tagData == nil check is something more essential than it seems. ( It doesn't generate errors ). In macOS it could corrupt tests.

valeriyvan commented 6 years ago

With or without this fix macOS tests fail. Some weird memory problems. I guess problem is not in this fix but in somewhere else.

wanght1029 commented 4 years ago

What did you do by clicking on correct Base64 encode? Because I need to click on the string that will be generated

lolgear commented 3 years ago

@valeriyvan Sorry, It's been a long time since your PR was introduced. If you don't mind I added this PR via combining it with another PR. I guess it could be closed. Could you check latest master?

Thanks!