|
|
@ -37,7 +37,7 @@ const ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
var ( |
|
|
|
ErrSymAsym = errors.New("specify either a symetric or a asymmetric key") |
|
|
|
ErrSymAsym = errors.New("specify either a symmetric or an asymmetric key") |
|
|
|
ErrInvalidSymmetricKey = errors.New("invalid symmetric key") |
|
|
|
ErrInvalidSymmetricKey = errors.New("invalid symmetric key") |
|
|
|
ErrInvalidPublicKey = errors.New("invalid public key") |
|
|
|
ErrInvalidPublicKey = errors.New("invalid public key") |
|
|
|
ErrInvalidSigningPubKey = errors.New("invalid signing public key") |
|
|
|
ErrInvalidSigningPubKey = errors.New("invalid signing public key") |
|
|
@ -243,7 +243,7 @@ func (api *PublicWhisperAPI) Post(ctx context.Context, req NewMessage) (bool, er |
|
|
|
err error |
|
|
|
err error |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// user must specify either a symmetric or a asymmetric key
|
|
|
|
// user must specify either a symmetric or an asymmetric key
|
|
|
|
if (symKeyGiven && pubKeyGiven) || (!symKeyGiven && !pubKeyGiven) { |
|
|
|
if (symKeyGiven && pubKeyGiven) || (!symKeyGiven && !pubKeyGiven) { |
|
|
|
return false, ErrSymAsym |
|
|
|
return false, ErrSymAsym |
|
|
|
} |
|
|
|
} |
|
|
@ -344,7 +344,7 @@ func (api *PublicWhisperAPI) Messages(ctx context.Context, crit Criteria) (*rpc. |
|
|
|
return nil, rpc.ErrNotificationsUnsupported |
|
|
|
return nil, rpc.ErrNotificationsUnsupported |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// user must specify either a symmetric or a asymmetric key
|
|
|
|
// user must specify either a symmetric or an asymmetric key
|
|
|
|
if (symKeyGiven && pubKeyGiven) || (!symKeyGiven && !pubKeyGiven) { |
|
|
|
if (symKeyGiven && pubKeyGiven) || (!symKeyGiven && !pubKeyGiven) { |
|
|
|
return nil, ErrSymAsym |
|
|
|
return nil, ErrSymAsym |
|
|
|
} |
|
|
|
} |
|
|
@ -534,7 +534,7 @@ func (api *PublicWhisperAPI) NewMessageFilter(req Criteria) (string, error) { |
|
|
|
err error |
|
|
|
err error |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// user must specify either a symmetric or a asymmetric key
|
|
|
|
// user must specify either a symmetric or an asymmetric key
|
|
|
|
if (symKeyGiven && asymKeyGiven) || (!symKeyGiven && !asymKeyGiven) { |
|
|
|
if (symKeyGiven && asymKeyGiven) || (!symKeyGiven && !asymKeyGiven) { |
|
|
|
return "", ErrSymAsym |
|
|
|
return "", ErrSymAsym |
|
|
|
} |
|
|
|
} |
|
|
|